GOTO crash
#1

Why does this script crash?
pawn Код:
if(!strcmp(cmd, "/goto", true))
    {
    //News
    new otherplayer;
    tmp = strtok(cmdtext, idx);

    //strlen
    if(!strlen(tmp))
            {
                SendClientMessage(playerid, RED,"USAGE: /goto [playerid]");
                return 1;
            }

    //strval
    otherplayer = strval(tmp);

    //Playerid = Connected
  if(IsPlayerConnected(otherplayer))
        {
            //News
            new interior;
            new othername[MAX_PLAYER_NAME];

            //Gets
            GetPlayerName(otherplayer, othername, sizeof(othername));
            GetPlayerPos(otherplayer, px, py, pz);
            interior = GetPlayerInterior(otherplayer);

            //Sets
            SetPlayerInterior(playerid, interior);
        SetPlayerPos(playerid, px, py, pz+2);

        //Text
        SendClientMessage(playerid, GREEN, "You've been teleported to %s (ID %d)!, othername, otherplayer");
        SendClientMessage(otherplayer, GREEN, "%s (ID %d) has been teleported to you!, name, playerid");

        //Print
            format(string, sizeof(string), "%s (ID %d) is teleported to %s (ID %d). ", name, playerid, othername, otherplayer);
            print(string);
        return 1;
        }
    else
        {
            SendClientMessage(playerid, RED, "That player isn't online!");
        }
return 1;
}
I defined name earlier in the script, and i used the goto only on myself (because there's nobody else on my server).

Do anybody have a idea?
Reply


Messages In This Thread
GOTO crash - by Remi-X - 04.04.2009, 13:38
Re: GOTO crash - by MenaceX^ - 04.04.2009, 13:44
Re: GOTO crash - by Remi-X - 04.04.2009, 13:47
Re: GOTO crash - by Torekk - 04.04.2009, 14:00
Re: GOTO crash - by Remi-X - 04.04.2009, 14:02
Re: GOTO crash - by Torekk - 04.04.2009, 14:09
Re: GOTO crash - by Remi-X - 04.04.2009, 14:12
Re: GOTO crash - by Tr1viUm - 04.04.2009, 14:15
Re: GOTO crash - by Remi-X - 04.04.2009, 14:20
Re: GOTO crash - by Tr1viUm - 04.04.2009, 14:21

Forum Jump:


Users browsing this thread: 1 Guest(s)