09.01.2011, 15:34
No need for sscanf in this situation. Although your sscanf syntax is wrong anyway, it should be:
But really you don't need it here, just this:
pawn Код:
if(sscanf(params,"s",reason))
pawn Код:
dcmd_die(playerid,params[])
{
new string[128],name[25];
if(!strlen(params)) SendClientMessage(playerid,red,"Usage: /die [reason]");
else
{
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s killed himself reason: %s",name,params);
SendClientMessageToAll(white,string);
SetPlayerHealth(playerid,0);
}
return 1;
}