06.05.2012, 01:15
I made this /hit command , but when i type it , automattically makes the Hit without a String , defines the string to 0 and then puts you ( you cant hit yourself)
Heres the code
Heres the code
pawn Код:
command(hit, playerid, params[])
{
new ID, amount;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME];
GetPlayerName(ID, name2, sizeof(name));
if(sscanf(params, "id", ID, amount)) SendClientMessage(playerid , CELESTE, "USAGE: /hit [id] [amount]");
if(!IsPlayerConnected(ID) == 0)
{
if(name2 = name)
{
new string[100], name[60], hitter[64];
GetPlayerName(ID, name, 60);
Hitcash[ID] = amount;
Hited[ID] = 1;
hiter[ID] = playerid;
GetPlayerName(playerid, hitter, 64);
format(string, 100, "You have placed a hit on %s(%d) for $%d . Hit Will last 24 Hours", name, ID, amount);
SendClientMessage(playerid, CELESTE, string);
GetPlayerName(playerid, name, 60);
format(string, 100, "%s[%d] has Placed a hit on You. For: $%d", hitter, playerid, amount);
SendClientMessage(ID, CELESTE, string);
format(string, sizeof(string), "%s has placed a hit on %s for $%d . The Hit will last for 24 Hours", hitter, name, amount);
SendClientMessageToAll(CELESTE, string);
}
return SendClientMessage(playerid,ROJOO,"You Canґt Hit Yourself");
}
return SendClientMessage(playerid, AMARILLO, "Player is not connected!");
return 1;
}