Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:robcluckin(playerid, params[])
- {
- #pragma unused params
- if (Robbed[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Command used recently... Please wait.");
- if (IsPlayerInCheckpoint(playerid) || GetPlayerInterior(playerid) == 9 || gTeam[playerid] == TEAM_CIVI || Robbed[playerid] == 0)
- {
- if (IsPlayerInRangeOfPoint(playerid, 2.0, 370.7102, -6.1440, 1001.8589))
- {
- new pName[MAX_PLAYER_NAME], str[128], rand, pFile[256], TmpZone[128];
- GetPlayerName(playerid, name, sizeof(name));
- format(file,sizeof(file),"/ACCOUNTS FOLDER/%s.ini",name);
- dini_IntSet(pFile, "RobSkill", PlayerInfo[playerid][RobSkill]+1);
- //SetPlayerScore(playerid, dini_Int(pFile, "Score"));
- //rand = random(400000);
- //GivePlayerMoney(playerid, rand);
- new robrand = random(400000);
- rand = robrand;
- GivePlayerMoney(playerid,robrand);
- format(str, sizeof(str), "|_ROBBERY_|: %s has recieved $%d from robbing Cluckin Bell!", pName, rand);
- SendClientMessageToAll(COLOR_GREEN, str);
- IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
- format(pFile, sizeof(pFile), SERVER_USER_FILE, pName);
- SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
- SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+4);
- SetTimer("Robbed1",100000,false);
- Robbed[playerid] = 1;
- dini_IntSet(pFile, "RobSkill", PlayerInfo[playerid][RobSkill]+1);
- dini_IntSet(pFile, "Score", PlayerInfo[playerid][Score]+1);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(gTeam[i] == TEAM_COPS || gTeam[i] == TEAM_ARMY)
- {
- GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
- format(str, sizeof(str), "|_STATION_|: (ROBBERY) %s(%d) Has robbed Cluckin Bell! Location: %s", pName, playerid, TmpZone);
- SendClientMessage(i, COLOR_BLUE, str);
- IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
- }
- }
- }
- }
- }
- else if (!IsPlayerInCheckpoint(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You're not in any checkpoint.");
- else if (gTeam[playerid] != TEAM_CIVI) return SendClientMessage(playerid, COLOR_ERROR, "Only civilians can rob.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement