Problem with a... variable? /goto command
#8

I don't know.. but it might work _:_ give it a try tho

PHP Code:
CMD:goto(playeridparams[])
{
    new 
idPlayer;
    new 
Float:xPlayerFloat:yPlayerFloat:zPlayer;
    new 
StringMen[64];
    new 
playername[MAX_PLAYER_NAME];
    new 
targetname[MAX_PLAYER_NAME];
    
GetPlayerName(idPlayer,targetname,sizeof(targetname));
    
GetPlayerName(playerid,playername,sizeof(playername));
    if(
Info[playerid][Admin] >= 1)
    {
        if(
sscanf(params,"u",idPlayer)) return SendClientMessage(playerid,-1"/goto [ID]");
        if(!
IsPlayerConnected(idPlayer)) return SendClientMessage(playerid, -1"The ID is wrong or the player isn't online!");
        if(
IsPlayerInAnyVehicle(playerid))
        {
              new 
vehicle GetPlayerVehicleID(playerid);
              new 
seat GetPlayerVehicleSeat(playerid);
              
GetPlayerPos(idPlayerxPlayeryPlayerzPlayer);
              
SetPlayerPos(playeridxPlayeryPlayer+2zPlayer);
              
SetVehiclePos(vehiclexPlayeryPlayer+2zPlayer);
              
PutPlayerInVehicle(playeridvehicleseat);
         }
         else
         {
            
GetPlayerPos(idPlayerxPlayeryPlayerzPlayer);
            
SetPlayerPos(playeridxPlayer+1yPlayer+1zPlayer);

            
format(StringMensizeof StringMen"[GOTO] %s teleported to %s"playernametargetname);
            
SendClientMessage(playerid, -1StringMen);

         }
    }
    else return 
SendClientMessage(playerid, -1"You're not allowed to use this command!");

    return 
1;

PS: sry for using English :P
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)