11.09.2013, 15:12
Hello, i have one problem this command /robbank I walk in any checkpoint gives me money like I robbed the bank, and if a player gives his money killing me after I came and give me money
Код:
if(strcmp(cmd, "/robbank", true) == 0) { if(CooldownRob[playerid]) return SendClientMessage(playerid,COLOR_1BLUE,"{2BB3D5}* Banca poate fi sparta doar o data la 2 ore !"); if(PlayerToPoint(3.0,playerid, 1237.7876,-729.1329,1088.0284)) { if(IsACop(playerid)) { SCM(playerid, COLOR_WHITE, "{F23A0D}* Nu poti sparge banca deoarece esti politist !"); return 1; } Robbing[playerid] = 1; CP[playerid] = 50; SetPlayerCheckpoint(playerid, 1460.9639, -1022.6666, 23.8281, 3.0); WantedLevel[playerid] = 0; new wanted = GetPlayerWantedLevel(playerid); WantedLevel[playerid] = wanted + 10; SetPlayerCriminal(playerid,255, "Ai spart banca !"); BizzInfo[0][bProducts] -= 20; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "{FF0000}WARNING{FFFFFF}: %s a spart banca,omoara-l sa ii furi banii!", name); SendClientMessageToAll(COLOR_GREY, string); for(new i = 0; i < MAX_PLAYERS; i++) { CooldownRob[i] = 7200; } } else { SendClientMessage(playerid, COLOR_GREY,"{C0C0C0}Trebuie sa fi in banca {ff0000}{C0C0C0} pentru a o jefui!"); return 1; } return 1;
Код:
else if(CP[playerid] == 50)//Robbing1 { CP[playerid] = 51; new rand; rand = random(sizeof(RandomRob)); SetPlayerCheckpoint(playerid, RandomRob[rand][0],RandomRob[rand][1],RandomRob[rand][2], 3.0); SendClientMessage(playerid, COLOR_YELLOW, "Acum pleaca la depozit pentru a lua banii!"); } else if(CP[playerid] == 51)//Robbing2 { new cashr; new str[128]; cashr = PlayerInfo[playerid][pLevel]*50000; PlayerInfo[playerid][pRob] -= 20; // PlayerInfo[playerid][pRobSkill] += 5; SafeGivePlayerMoney(playerid, cashr); SetVehicleToRespawn(GetPlayerVehicleID(playerid)); format(str, 128,"*Ai luat $%d pentru ca ai jefuit banca!", cashr); SendClientMessage(playerid, COLOR_YELLOW, str); DisablePlayerCheckpoint(playerid); CP[playerid] = 0; }