Someone got a script on /gotoco(ordinates)?
#6

Also a tip:

pawn Код:
CMD:gotoco(playerid, params[])
{
    new int, Float:x, Float:y, Float:z;
    // You can add your admin code here like "if(PlayerInfo[playerid][pAdmin]..."
    if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, int);
    return 1;
}
If you're gonna add admin check, add it above
new int, Float, Float:y, Float:z;

so variables aren't created uselessly if player isn't admin.

like this:
pawn Код:
CMD:gotoco(playerid, params[])
{
     if(!IsPlayerAdmin) return SendClientMessage(playerid, 0xFF0000AA, "You need to be an admin to use this command.");
    new int, Float:x, Float:y, Float:z;
    if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, int);
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)