Total Members Voted: 3
0 Members and 3 Guests are viewing this topic.
else if (strcmp(cmd, "transferstats", true) == 0) { new plr, plrr, szMsg[256]; tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp); plrr = FindPlayerIDFromString(tmp); if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!"); /// else if(!IsPlayerCommandLevel(playerid,"transferstats")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!"); else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c transferstats [Nick/ID]"); else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player"); else if(!IsPlayerRegistered(gPlayers[plrr])) { format(szMsg,sizeof(szMsg),"Error: %s is not a registered nick!",gPlayers[plrr]); SendClientMessageToAll(COLOR_GREEN,szMsg); } else { new OLDKILLS[MAX_PLAYERS]; new OLDDEATHS[MAX_PLAYERS]; format(file, sizeof(file), USERS_FILE, gPlayers[plr]); OLDKILLS[plr] = dini_Int(file, "Kills"); OLDDEATHS[plr] = dini_Int(file, "Deaths"); format(file, sizeof(file), USERS_FILE, gPlayers[plrr]); dini_Set(file, "Deaths", OLDDEATHS[playerid]); dini_Set(file, "Kills", OLDKILLS[playerid]); format(szMsg,sizeof(szMsg),"%s's stats transfered to %s.",gPlayers[plr], gPlayers[plrr]); SendClientMessage(playerid,COLOR_GREEN,szMsg); format(file, sizeof(file), USERS_FILE, gPlayers[plr]); dini_Set(file, "Deaths", "0"); dini_Set(file, "Kills", "0"); } return 1; }
i m a great script Editor