19.03.2013, 18:30
if im not sure you are not allowed to have call 911 with spaces.
and for other errors. it says that there is already a variable for pName and str
i suggest using strcmp if you really want a command with spaces on it
Example
EDIT
Here you go. but i think Misiur is much better one you can use his or mine you're choice
and for other errors. it says that there is already a variable for pName and str
i suggest using strcmp if you really want a command with spaces on it
Example
pawn Код:
new
call911[24]
;
if(!strcmp(call911, "911", true))
{
//code here
}
Here you go. but i think Misiur is much better one you can use his or mine you're choice
pawn Код:
CMD:call 911(playerid, params[])
{
new
message[128],
call911[24]
;
if(sscanf(params, "s[24]", call911))
return SendUsageError( playerid, "/call 911 [Message]" );
if(!strcmp(call911, "911", true))
{
new
str[128],
pName[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizeof(pName), "[911] %s has called 911! Message: %s", pName, message);
SendClientMessage(playerid, COP_MESSAGE, str);
}
return 1;
}