01.07.2008, 19:03
Drug system
This is my nearly working Drug System that is less then 100 lines!
--- New ---
--- Commands ---
Bugs:
-No errors at compiling
-When im on server i do /usedrugs it uses them without having them
-When i do /givedrugs is not giving.
I cant figure it out what is wrong here a little help is appreciated!
And btw... if we fix this... is free for everybody to take it
This is my nearly working Drug System that is less then 100 lines!
--- New ---
Код:
new offerweed[MAX_PLAYERS]; new haveweed[MAX_PLAYERS];
Код:
if(strcmp(cmdtext,"/givedrugs",true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREEN, "USAGE: /givedrugs [playerid/PartOfName] [amount]"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREEN, "USAGE: /givedrugs [playerid/PartOfName] [amount]"); return 1; } offerweed[giveplayerid] = 1; GivePlayerMoney(playerid, 0 - 10); GivePlayerMoney(playerid,10); SendClientMessage(playerid, 0x00FF00AA, "Drugs sent"); SendClientMessage(giveplayerid, 0x00FF00AA, "Money recieved"); } return 1; } if(strcmp(cmdtext, "/usedrugs", true)==0) { if (haveweed[playerid] < 0 || haveweed[playerid] > 999999) { SendClientMessage(playerid, COLOR_RED, "SERVER MESSAGE: You dont have any drugs "); return 1; } else { SendClientMessage(playerid,COLOR_LIGHTBLUE,"SERVER MESSAGE: You smoked drugs and you are high now!"); } SetPlayerHealth(playerid,100); return 1; }
-No errors at compiling
-When im on server i do /usedrugs it uses them without having them
-When i do /givedrugs is not giving.
I cant figure it out what is wrong here a little help is appreciated!
And btw... if we fix this... is free for everybody to take it