29.10.2012, 17:41
ok, This command let's player's do when other player is not connected
help please.
pawn Код:
COMMAND:setint(playerid, params[])
{
new id;
new interior;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 1)
{
if(!sscanf(params, "ui", id, interior))
{
if(interior <= 100)
{
new string[64];
new name[MAX_PLAYER_NAME], PName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PName, sizeof(PName));
format(string, sizeof(string), "Your Interior Has Been Setted To %d By %s.", interior, name);
SendClientMessage(id, 0xD8D8D8FF, string);
format(string, sizeof(string), "You Setted %s Interior To %d.", PName, interior);
SendClientMessage(playerid, 0xD8D8D8FF, string);
SetPlayerInterior(id, interior);
return 1;
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "Invalid Interior Id");
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /setint [PlayerId/PartOfName] [Interior]");
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}