12.12.2010, 15:48
Hey guys,
I made myself a /setscore command. When i type /setscore 999 it says i have set my score to 0. Can you also make this save so when i log in and log out it stays.
Thanks.
I made myself a /setscore command. When i type /setscore 999 it says i have set my score to 0. Can you also make this save so when i log in and log out it stays.
Код:
dcmd_setscore(playerid, params[]) { new givePlayer, pName[24], ReturnUserName[24], str[128], score; if(PlayerInfo[playerid][AdminLevel] < 4) { SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!"); return 1; } if(sscanf(params, "u", givePlayer, score)) { SendClientMessage(playerid, COLOR_GRAD1,"Usage: /setscore [playerid] [score]"); } if(!IsPlayerConnected(givePlayer)) { SendClientMessage(playerid, COLOR_RED, "Invalid playerid"); } if(score <0 || score > 999999) { SendClientMessage(playerid, COLOR_GRAD1, "The score cannot be lower than 0 and be higher than 999999"); } GetPlayerName(playerid, pName, sizeof(pName)); GetPlayerName(givePlayer, ReturnUserName, sizeof(ReturnUserName)); SetPlayerScore(givePlayer, score); format(str, sizeof(str), "**(Admin)** %s (ID: %d) has set %s (ID: %d) score to %d.", pName, playerid, ReturnUserName, givePlayer, score); SendmAdminMsg(COLOR_LIGHTRED, str); return 1; }