Author Topic: [Help!] How to make !goto in 3 seconds?  (Read 2845 times)

0 Members and 1 Guest are viewing this topic.

Offline gta-vc

  • Street Thug
  • *
  • Posts: 1
    • View Profile
[Help!] How to make !goto in 3 seconds?
« on: June 18, 2011, 06:22:13 am »
I want to make a !goto script: when a player go to another player, he will be lock, and he will
be unlock in 3 seconds.

How to make it?

Sorry my English is poor... :-[

BTW:
http://forum.vicecitymultiplayer.com/index.php?topic=2829.msg21158#msg21158
That script something wrong...

THX a lot!
All The Wind


Offline [SUK]vivamexico

  • Street Thug
  • *
  • Posts: 16
  • Nice
    • View Profile
Re: [Help!] How to make !goto in 3 seconds?
« Reply #1 on: June 25, 2011, 04:20:41 am »
hmmm....
you have to do is a function as:

[pawn]//--------------------------------Command------------------------------------------\\

   if (strcmp(cmd, "!goto", true) == 0) {
      tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!strlen(tmp)) SendClientMessage(playerid, COLOR_GREY, "Usage: !goto [Nick/ID]");
      else {
          new plr = FindPlayerIDFromString(tmp);
          if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_GREEN,"Error: Unknown player");
          else if (PlayerInfo[plr][NoGoto] == 1) SendClientMessagef(playerid,COLOR_GREEN, "%s has goto Disabled.",strval(gPlayers[plr]));
          else if (!IsPlayerSpawned(plr)) SendClientMessagef(playerid,COLOR_GREEN, "Error: %s does not spawned!",gPlayers[plr]);
          else {
                SendClientMessage(playerid, COLOR_GREEN,">> pm** Please wait <5> Seconds...");
                format(szMsg,sizeof(szMsg),"[%d]%s is this teleporting toward you",playerid,gPlayers[playerid]);
                SendClientMessage(plr,COLOR_GREEN, szMsg);
            GameTextForPlayer(playerid,"~h~tp..");
            SetTimer("GOTO", 3000, 0, player, plr );
         }
  }
      return 1;
}

//------------------------------------------FUNCTION---------------------------------------------------\\

public GOTO(plr, playerid)
{
new szMsg[256], Float:x, Float:y, Float:z;
GetPlayerPos(plr,x,y,z);
SetPlayerPos(playerid,x,y + 1.0,z,0,0);
format(szMsg,sizeof(szMsg),"Teleporting:[ %s ] to:[ %s ]",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_GREEN, szMsg);
}[/pawn]
Oks.

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: [Help!] How to make !goto in 3 seconds?
« Reply #2 on: June 25, 2011, 04:40:21 am »
[pawn]SetTimer("GOTO", 3000, 0, player, plr );[/pawn]

Will not work. Pawn's SetTimer does not work like SetTimerEx in SA:MP, and SetTimerEx doesn't exist in VC:MP. It works in Squirrel, though.
Do not PM me for support.




Offline [SUK]vivamexico

  • Street Thug
  • *
  • Posts: 16
  • Nice
    • View Profile
Re: [Help!] How to make !goto in 3 seconds?
« Reply #3 on: June 29, 2011, 05:21:22 pm »
hehe, I already knew that would not work

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: [Help!] How to make !goto in 3 seconds?
« Reply #4 on: June 30, 2011, 06:02:11 pm »
hehe, I already knew that would not work
lololol why you post it then >.<