09.05.2014, 04:48
Код:
dcmd_givemoney(playerid,params[]){ if(ServerInfo[GiveMoney]==0){ CommandDisabled(playerid);} if(Account[playerid][pAdminlevel]<CmdsOptions[GiveMoney]){ format(string, sizeof(string), LanguageText[0], CmdsOptions[GiveMoney]); SendClientMessage(playerid, COLOR_LIGHTRED, string);}else if(Account[playerid][pAdminlevel]>=CmdsOptions[GiveMoney]) if(ServerInfo[GiveMoney]==1){ new tmp[MAX_SERVER_STRING],tmp2[MAX_SERVER_STRING],ammount, Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index); if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_WHITE, LanguageText[282]); return 1;} if(!IsNumeric(tmp)){ SendClientMessage(playerid, COLOR_LIGHTRED, LanguageText[40]); return 1;} if(!strlen(tmp2)){ SendClientMessage(playerid, COLOR_WHITE, LanguageText[282]); return 1;} player = strval(tmp); ammount = strval(tmp2); if(!IsPlayerConnected(player)){ SendClientMessage(playerid, COLOR_LIGHTRED, LanguageText[41]); return 1;} if(ammount<0){ SendClientMessage(playerid, COLOR_LIGHTRED, LanguageText[283]); return 1;} GetPlayerName(player, incriminato, sizeof(incriminato)); GetPlayerName(playerid, adminname, sizeof(adminname)); format(string, sizeof(string), LanguageText[284], adminname, incriminato, ammount); SendClientMessageToAll(COLOR_LIGHTRED, string); #if defined SpecialAntiMoneyHack GiveZMoney(player,ammount); #else GivePlayerMoney(player,ammount); #endif } return 1;}