01.12.2012, 20:31
Quote:
Код HTML:
CMD:flowers(playerid, params[]) {
new id, message[1024],szString[1024];
if(sscanf(params,"ds[1024]",id,message))return SendClientMessage(playerid, COLOR_RED, "USAGE: /giveflowers <playerid>");
if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");
if(playerid != id) {
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
new ReturnName[MAX_PLAYER_NAME];
GetPlayerName(id, ReturnName, sizeof(ReturnName));
format(szString,sizeof(szString), "You have send flowers to %s", ReturnName);
SendClientMessage(playerid, 0xFFCC2299, szString);
format(szString,sizeof(szString),"You have recived flowers from %s!",PlayerName);
SendClientMessage(id, 0xFFFF22AA, szString);
GivePlayerWeapon(id,14,1);
GivePlayerWeapon(playerid,14,0);
}
else {
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot give the flowers for yourself! :O");
}
return 1;
}
|
pawn Код:
new id, message[1024],szString[1024];
if(sscanf(params,"ds[1024]",id,message))return SendClientMessage(playerid, COLOR_RED, "USAGE: /giveflowers <playerid>");
when it needs to be
pawn Код:
new id;
if(sscanf(params,"r",id))return SendClientMessage(playerid, COLOR_RED, "USAGE: /giveflowers <playerid>");