30.08.2014, 00:48
Quote:
What means pragma un used params and i will start fixing them like /goto [ID]
|
Program unused "params" means that I'm not using that parameter in the command.
On your next command if you use parameters.
Works with zcmd and sscanf, are very good.
pawn Код:
command(goto, playerid, params[])
{
if(Player[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, -1, "How to use: /goto [playerid/name].");
if(IsPlayerConnected(params[0]) && params[0] != INVALID_PLAYER_ID)
{
if(params[0] != playerid)
{
new Float:Pos[3];
GetPlayerPos(params[0], Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(params[0]));
SetPlayerInterior(playerid, GetPlayerInterior(params[0]));
}
else
{
SendClientMessage(playerid, -1, "You can't go toward yourself.");
}
}
else
{
SendClientMessage(playerid, -1, "Player disconnected.");
}
}
else
{
SendClientMessage(playerid, -1, "You need to be administrator to use this command.");
}
return 1;
}