15.02.2013, 11:23
I put this code
and I get this errors
And I already have puted this Stock
Код:
CMD:sellak(playerid, params[])
{
new playerb, bullets, string[128];
if(!IsPlayerInRangeOfPoint(playerid,7, 2799.7219,-2417.6570,13.6307)) return SendClientMessage(playerid,-1,"You are not at the right place!");
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerame, sizeof(playername));
if(strfind(playername, "[SC]", true) != -1)
if(sscanf(params,"ii",playerb,bullets)) return SendClientMessage(playerid,-1,"Usage: /sellak [id] [ammo]");
if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid,-1,"You are too far away from that player!");
format(string, sizeof(string), "** %s takes out a AK-47 and a box of ammo as he passes it to %s", NAMEGET(playerid), NAMEGET(playerb), bullets);
NearMessageSender(playerid, 7, string, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
format(string, sizeof(string), "Gun Dealer %s has given you a AK-47 and a box of ammo.", NAMEGET(playerid));
SendClientMessage(playerb, COLOR_RED, string);
GivePlayerWeapon(playerb, 30, bullets);
GivePlayerMoney(playerid, -200);//you can change the ammount of money taken from the player
return 1;
}
and I get this errors
Код:
C:\Users\Giannis\Desktop\RP.pwn(310) : error 017: undefined symbol "playerame" C:\Users\Giannis\Desktop\RP.pwn(310) : error 017: undefined symbol "playername" C:\Users\Giannis\Desktop\RP.pwn(310) : error 029: invalid expression, assumed zero C:\Users\Giannis\Desktop\RP.pwn(310) : fatal error 107: too many error messages on one line
Код:
stock NAMEGET(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;

