CMD:explode(playerid, params[])
{
if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3)return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
new string[128], ID, Float:x, Float:y, Float:z;
if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_RED, "Usage: /explode [playerid/name]");
else if(!IsPlayerConnected(ID)) SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected.");
else
{
GetPlayerPos(ID, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
format(string,sizeof(string), "You have exploded %s(%d).", PlayerName(ID), ID);
SendClientMessage(playerid, COLOR_PURPLE, string);
}
return;
}
C:\Users\tadej\Desktop\My Server, Don't touch!\gamemodes\Samp.pwn(514) : error 017: undefined symbol "PlayerName" C:\Users\tadej\Desktop\My Server, Don't touch!\gamemodes\Samp.pwn(517) : warning 209: function "cmd_explode" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
CMD:explode(playerid, params[])
{
if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
new string[128], ID, Float:x, Float:y, Float:z;
if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_RED, "Usage: /explode [playerid/name]");
else if(!IsPlayerConnected(ID)) SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected.");
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(ID, pName, MAX_PLAYER_NAME);
GetPlayerPos(ID, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
format(string,sizeof(string), "You have exploded %s(%d).", pName, ID);
SendClientMessage(playerid, COLOR_PURPLE, string);
}
return 1;
}
pawn Код:
|