12.07.2010, 08:56
whats wrong with this PM command
sscanf is stocked at bottom of my script
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; new idx; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/legopm", true) == 0) { new giveplayerid, msg; if (sscanf(cmdtext[idx], "us", giveplayerid, msg)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /pm [playerid/part of name] [message]"); else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found"); else { new Sname[MAX_PLAYER_NAME], Rname[MAX_PLAYER_NAME]; new rstring[126],sstring[126]; GetPlayerName(playerid, Sname, sizeof(Sname)); GetPlayerName(giveplayerid, Rname, sizeof(Rname)); format(rstring,sizeof(rstring),"*PM* recieved from %s(%i):%s",Sname,playerid,msg); format(sstring,sizeof(sstring),"*PM* sent to %s(%i):%s",Rname,giveplayerid,msg); SendClientMessage(playerid, COLOR_RECIEVE_PM, rstring); SendClientMessage(playerid, COLOR_SEND_PM, sstring); } return 1; } return 0; }