16.02.2014, 16:16
i found this command useful for my server
i always use zcmd and strok is difficult for me
i want to convert it to zcmd
i tried a lot to do it but i failed.
if someone could help make and convert this to zcmd or just only in the important parts
no problem if you modify or reduce the lines it but it should do the same thing.
Thanks
Quote:
if(strcmp(cmd,"/bet", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bet [amount] [color (red or black)]"); new amount = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bet [amount] [color (red or black)]"); new rand = random(2); new string[128]; if(!rand) { if(strcmp(tmp, "red", true) == 0) { if(GetPlayerMoney(playerid) >= amount) { GivePlayerMoney(playerid, amount); format(string, sizeof(string), "RED WINS: You win %d dollars !",amount); SendClientMessage(playerid, COLOR_WHITE, string); }else SendClientMessage(playerid, COLOR_WHITE, "You dont have this moneys"); } else if(strcmp(tmp, "black", true) == 0) { if(GetPlayerMoney(playerid) >= amount) { GivePlayerMoney(playerid, -amount); format(string, sizeof(string), "BLACK WINS: You lose %d dollars !",amount); SendClientMessage(playerid, COLOR_WHITE, string); }else SendClientMessage(playerid, COLOR_WHITE, "You dont have this moneys"); }else SendClientMessage(playerid, COLOR_WHITE, "Only Red or White"); }else{ if(strcmp(tmp, "black", true) == 0) { if(GetPlayerMoney(playerid) >= amount) { GivePlayerMoney(playerid, amount); format(string, sizeof(string), "BLACK WINS: You win %d dollars !",amount); SendClientMessage(playerid, COLOR_WHITE, string); }else SendClientMessage(playerid, COLOR_WHITE, "You dont have this moneys"); } else if(strcmp(tmp, "red", true) == 0) { if(GetPlayerMoney(playerid) >= amount) { GivePlayerMoney(playerid, -amount); format(string, sizeof(string), "RED WINS: You lose %d dollars !",amount); SendClientMessage(playerid, COLOR_WHITE, string); }else SendClientMessage(playerid, COLOR_WHITE, "You dont have this moneys"); }else SendClientMessage(playerid, COLOR_WHITE, "Only Red or White"); } return 1; } |
i want to convert it to zcmd
i tried a lot to do it but i failed.
if someone could help make and convert this to zcmd or just only in the important parts
no problem if you modify or reduce the lines it but it should do the same thing.
Thanks