PDA

View Full Version : Help with warning


kaloqn54
28/07/2013, 10:05 AM
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

Xabi
28/07/2013, 10:07 AM
251 Heroin[playerid];

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

Konstantinos
28/07/2013, 10:14 AM
Like the warning said: expression has NO effect.

This

new Heroin[MAX_PLAYERS];

should be a global variable.

This

Heroin[playerid];

does nothing. You can only assign a value or check a value with.

ToiletDuck
28/07/2013, 10:54 AM
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