Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: gta-vc on June 18, 2011, 06:22:13 am

Title: [Help!] How to make !goto in 3 seconds?
Post by: gta-vc 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!
Title: Re: [Help!] How to make !goto in 3 seconds?
Post by: [SUK]vivamexico 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.
Title: Re: [Help!] How to make !goto in 3 seconds?
Post by: stormeus 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.
Title: Re: [Help!] How to make !goto in 3 seconds?
Post by: [SUK]vivamexico on June 29, 2011, 05:21:22 pm
hehe, I already knew that would not work
Title: Re: [Help!] How to make !goto in 3 seconds?
Post by: thijn on June 30, 2011, 06:02:11 pm
hehe, I already knew that would not work
lololol why you post it then >.<