GiveDrugWithOptions(playerid, .graines = dStats[d_coGraines], .type = DRUGTYPE_COCAINE);
(235) : warning 219: local variable "type" shadows a variable at a preceding level (472) : warning 219: local variable "type" shadows a variable at a preceding level (540) : warning 219: local variable "type" shadows a variable at a preceding level (576) : warning 219: local variable "type" shadows a variable at a preceding level
GiveDrugWithOptions(playerid, _, _, dStats[d_coGraines], DRUGTYPE_COCAINE);
As it says, local variable "type" shadows a variable at a preceding level. Which means that it is already used previously somewhere in the code on a level that is not local.
Either remove the occurrence in the preceding level or change the variable name to something that is not used yet. And your first post was not descriptive so I wouldn't know what to answer with. |
ApplyDrugEffect(playerid, Float:quantite, type)
GiveDrugWithOptions(playerid, champid = INVALID_DRUG_ID, feuilles = 0, graines = 0, type = DRUGTYPE_COCAINE)
Are you sure it comes exactly from this line? because pawn compiler is dumb and when you forget to declare a variable somewhere but use it, it throws false shadow warnings of that variable everywhere.
I got a bunch of those single parameter with names and even literally have .playerid=playerid in half dozen parts of my code (streamer related mostly) and there's not a single warning, I advice you to check other places you use type, maybe one of them isn't declared properly. |
else if(!strcmp("/arrestdealer", cmdtext, true, strlen("/arrestdealer")))
{
if(!IsAFDLMember(playerid))
SCM(playerid, RED, PLAYER_UNAUTHORIZED);
if(GetNearestDealer(playerid) == INVALID_DRUG_ID)
return SCM(playerid, RED, NOT_NEAR_DEALER);
// SendMessageToRadio(playerid, "%s a arrкte le dealer de drogue.. Le dealer avait %i graines de cannabis & %i graines de cocaine.");
DestroyActor(dStats[dID]);
SetTimer("CreateDealer", DEALER_HEURE*1000, false); // (60*1000)*60*DEALER_HEURE <- Real time
DestroyDynamic3DTextLabel(dStats[dLabel]);
Me_Auto(playerid, "vient d'arrкter le dealer de drogue. On risque pas le voir avant quelques heures.");
GiveDrugWithOptions(playerid, _, _, dStats[d_coGraines], DRUGTYPE_COCAINE);
// GiveDrugWithOptions(playerid, .graines = dStats[d_coGraines], .type = DRUGTYPE_COCAINE);
return 1;
}
new type; // Creating Errors
enum MyEnum
{
type, // Creating errors
value
};
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/planter", cmdtext, true, strlen("/planter")))
{
if(!IsGangMember(playerid))
return SCM(playerid, RED, PLAYER_UNAUTHORIZED);
new type;
...
Just rename it to drug_type, you are wasting a time. "Type" can be even declared in your includes.
|