05.07.2010, 18:05
pawn Код:
else if(strcmp(x_nr,"relv",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /anna gun [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(ProxDetectorS(5.0, playerid, giveplayerid))
{
new gunID = GetPlayerWeapon(playerid);
new gunAmmo = GetPlayerAmmo(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(gunID != 0 && gunAmmo != 0)
{
//SafeGivePlayerWeapon(giveplayerid, gunID, gunAmmo);
RemovePlayerWeapon(playerid, gunID);
RelvNimi[playerid] = gunID;
RelvKuul[playerid] = gunAmmo;
RelvSaam[playerid] = 1;
format(string, sizeof(string), "[SЬSTEEM] %s tahab anda sulle relvi. [Relv: %d || Laskemoon: %d]", gunID, gunAmmo);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid, COLOR_WHITE, "[SЬSTEEM] Kui tahad nхustuda relva andmist, siis kirjuta /nхustu relv.");
format(string, sizeof(string), "* %s annab oma relva %s.", sendername, giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Sul ei ole relvi, et mida anda!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Mдngija ei ole sinu lдhedal!");
return 1;
}
}
}
}
[SЬSTEEM] %s tahab anda sulle relvi. [Relv: %d || Laskemoon: %d]", gunID, gunAmmo
I think %d is wrong.
I have minigun and giving to him, then shows:
[SЬSTEEM] Alex tahab anda sulle relvi. [Relv: 500 || Laskemoon: 0]
must be
[SЬSTEEM] Alex tahab anda sulle relvi. [Relv: 38 || Laskemoon: 100]
38 is minigun ID
100 is ammo