Only id 0 getting drugs
#1

after players harvest the drugs they should get 50 grams of drugs, but instead of players that actually harvested it, only player id 0 is getting drugs.
this is the command

if(strcmp(cmd, "/harvest1", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 10,-1073.7500,-1095.6509,129.218 && PlayerInfo[playerid][pJob] == 4 && plant1 == 1 && PlayerInfo[playerid][pHarvest] == 1)
{
plant1 = 0;
DestroyDynamicObject(bigplant1);
PlayerInfo[playerid][pHarvest] = 0;
PlayerInfo[giveplayerid][pDrugs] += 50;
SCM(playerid, COLOR_WHITE, "+ 50 drugs!");
}
else
{
SCM(playerid, COLOR_WHITE, "Error!");
}
return 1;
}
Reply
#2

Change this:
Код:
PlayerInfo[giveplayerid][pDrugs] += 50;
To:
Код:
PlayerInfo[playerid][pDrugs] += 50;
Reply
#3

Change:
pawn Код:
PlayerInfo[playerid][pHarvest] = 0;
PlayerInfo[giveplayerid][pDrugs] += 50;
to:
pawn Код:
PlayerInfo[playerid][pHarvest] = 0;
PlayerInfo[playerid][pDrugs] += 50;
You were giving the drugs to ID 'giveplayerid' which would be 0 by default.
Reply
#4

Thanks, works now ^^
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)