Help with warning - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with warning (
/showthread.php?tid=454277)
Help with warning -
kaloqn54 - 28.07.2013
Код:
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
Respuesta: Help with warning -
Xabi - 28.07.2013
251 Heroin[playerid];
What do you want to do with that line? You are just typing the variable, not doing anything with it.
Re: Help with warning -
Konstantinos - 28.07.2013
Like the warning said: expression has NO effect.
This
should be a global variable.
This
does nothing. You can only assign a value or check a value with.
Re: Help with warning -
ToiletDuck - 28.07.2013
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