28.05.2012, 09:03
Okay so im making a drug system where a player can buy drugs and like plant and make them. Basicly this is my code.
When i use the following code and go to the area the drugs are ment t be buyable at and type the code nothing happens and when i do the /plantdrug command it says i have no drugs. Okay noow if i have this code
and type /plantdrugs it only makes a weed plant. This is my code for /plantdrugs
Код:
COMMAND:buydrugs(playerid, params[]) // or CMD:mycommand(playerid, params[]) { if(pInfo[playerid][HASDRUGS] == 0 && IsPlayerInRangeOfPoint(playerid, 1.0, -1136.4224,-2861.4194,270.5641)) { pInfo[playerid][HASWEED] = 1; pInfo[playerid][PLANTID] = 1759; } if(pInfo[playerid][HASDRUGS] == 0 && IsPlayerInRangeOfPoint(playerid, 1.0, -1140.2141,-2862.9775,270.5641)) { pInfo[playerid][HASCRACK] = 1; pInfo[playerid][PLANTID] = 1712; } else { SendClientMessage(playerid, 0xFFFFFF,"you all ready own some drugs"); } return 1; }
Код:
COMMAND:buydrugs(playerid, params[]) // or CMD:mycommand(playerid, params[]) { IsPlayerInRangeOfPoint(playerid, 1.0, -1136.4224,-2861.4194,270.5641)) if(pInfo[playerid][HASDRUGS] == 0) { pInfo[playerid][HASWEED] = 1; pInfo[playerid][PLANTID] = 1759; } IsPlayerInRangeOfPoint(playerid, 1.0, -1140.2141,-2862.9775,270.5641)) if(pInfo[playerid][HASDRUGS] == 0) { pInfo[playerid][HASCRACK] = 1; pInfo[playerid][OBJECTID] = 1712; } else { SendClientMessage(playerid, 0xFFFFFF,"you all ready own some drugs"); } return 1; }
Код:
COMMAND:placechair(playerid, params[]) // or CMD:mycommand(playerid, params[]) { if(pInfo[playerid][HASDRUGS] == 1 && pInfo[playerid][PLANTID] == 1712) { new Float:x; new Float:y; new Float:z; GetPlayerPos(playerid,x,y,z); DX = x; DY = y; DZ = z - 5; CreateDynamicObject(pInfo[playerid][PLANTID], DX, DY, DZ, 0, 0, 0, pInfo[playerid][Dworld], pInfo[playerid][Dint], -1, 200.0); } if(pInfo[playerid][HASDRUGS] == 1 && pInfo[playerid][PLANTID] == 1759) { new Float:x; new Float:y; new Float:z; GetPlayerPos(playerid,x,y,z); DX = x; DY = y; DZ = z - 5; CreateDynamicObject(pInfo[playerid][PLANTID], DX, DY, DZ, 0, 0, 0, pInfo[playerid][Dworld], pInfo[playerid][Dint], -1, 200.0); } else { SendClientMessage(playerid, 0xFFFFFF,"you do not own any drugs."); } return 1; }