Help with warning
#1

Код:
CMD:checkdrugs(playerid, params[])
{
 new string[128];
 new Heroin[MAX_PLAYERS];
 251 Heroin[playerid];
 format(string, sizeof(string), "Ти имаш %d Heroin", Heroin[playerid]);
 SendClientMessage(playerid, 0xFFFFFFFF, string);
 return 1;
}
D:\igri\GTA San Andreas\filterscripts\fuck.pwn(251) : warning 215: expression has no effect
Reply
#2

251 Heroin[playerid];

What do you want to do with that line? You are just typing the variable, not doing anything with it.
Reply
#3

Like the warning said: expression has NO effect.

This
pawn Код:
new Heroin[MAX_PLAYERS];
should be a global variable.

This
pawn Код:
Heroin[playerid];
does nothing. You can only assign a value or check a value with.
Reply
#4

pawn Код:
new Heroin[MAX_PLAYERS]; // Global Variables put this top of your script

//under onplayerconnect
Heroin[playerid] = 0; // It means that if player connect the heroin is equal to 0 this is to avoid get bug if you forgot to do this if player connect his heroin will be randomly define for example if player connect sometimes he will be given 3 heroin

CMD:checkdrugs(playerid, params[])
{
 new string[128];
// new Heroin[MAX_PLAYERS]; its already define
// 251 Heroin[playerid]; remove this
 format(string, sizeof(string), "Ти имаш %d Heroin", Heroin[playerid]); // There it define how many heroin of a player when they use this command
 SendClientMessage(playerid, 0xFFFFFFFF, string);
 return 1;
}
sorry i cant explain well LOL im just trying my best
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)