/tp [id] Problem
#1

pawn Код:
#include <a_samp>
    new tmp[256];
    new OtherID = strval(tmp);

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tp", cmdtext, true, 6) == 0)
    {
        new tmp[256];
        new OtherID = strval(tmp);
        }
        if(!strlen(tmp)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /tp [id]");
        if(!IsPlayerConnected(OtherID) || IsPlayerNPC(OtherID)) return SendClientMessage(playerid,0xFF0000FF,"The player is not online!");
        new Float:X, Float:Y, Float:Z;
        }
        GetPlayerPos(OtherID, X, Y, Z);
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
        SetVehiclePos(GetPlayerVehicleID(playerid), X+5, Y+5, Z);
        }
        else
        {
       SetPlayerPos(playerid, X+5, Y+5, Z);
        }
        SendClientMessage(playerid, 0xFF0000FF, "You've been teleported to the requested player!");
        return 1;
    }
    return 0;
}
It gives me this error "Windows has stopped working"
Reply


Messages In This Thread
/tp [id] Problem - by XVK - 05.08.2011, 05:04
Re: /tp [id] Problem - by dr.pepper - 05.08.2011, 05:07
Re: /tp [id] Problem - by Famalamalam - 05.08.2011, 05:51
Re: /tp [id] Problem - by XVK - 05.08.2011, 14:56
Re: /tp [id] Problem - by Kingunit - 05.08.2011, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)