01.06.2013, 14:29
(
Последний раз редактировалось drichie; 16.06.2013 в 09:32.
)
i made a command the give players money when type but it doesn't add to my cash well sorry for my bad English this image will tell you what my problem is and as for me being a beginner trying to learn how to script i will very thankful whoever can explain why it isn't work and what should i do to make this work without changing much

this is my command i made
this is my stock code for that
as youve noticed i used stock for a command and i know as for beginner it isnt necessary but for me its a great way to learn and know how things work...i only rip this code from other gamemode from that gamemode it works properly but i cant figure out why it isnt working for my script so ive come here to search some help

this is my command i made
Код:
CMD:givemoney(playerid, params[]) { new playerb, amount; if(sscanf(params,"ui",playerb,amount)) return SendClientMessage(playerid,lblue, "USAGE: /givemoney [playerid][amount]"); if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid,gray, "Invalid player id."); GiveDrichMoney(playerb, amount); return 1; }
Код:
stock GiveDrichMoney(playerid, amount) { new string[128]; if(amount < 0) format(string, sizeof(string), "~r~-$%d", amount*-1); else if(amount > 0) format(string, sizeof(string), "~g~+$%d", amount); GameTextForPlayer(playerid, string, 3000, 1); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); pdata[playerid][pcash] += amount; return 1; }