15.06.2014, 10:03
I have script rob system and now... When i rob any player there are 2 or 3-4 stairs, but i can't get new color as wanted level.... what is problem?
and down..
Can any good scripter fix this problem please?
Код:
CMD:rob(playerid, params[]) { new id, string[126]; if(Ulogiran[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Nisi ovlascen da koristis ovu komandu"); if(gTeam[playerid] == TEAM_COP) return SendClientMessage(playerid, 0xFF0000FF, "Nisi ovlascen da koristis ovu komandu"); if(gTeam[playerid] == TEAM_ARMY) return SendClientMessage(playerid, 0xFF0000FF, "Nisi ovlascen da koristis ovu komandu"); if(gTeam[playerid] == TEAM_SWAT) return SendClientMessage(playerid, 0xFF0000FF, "Nisi ovlascen da koristis ovu komandu"); if(gTeam[playerid] == TEAM_FBI) return SendClientMessage(playerid, 0xFF0000FF, "Nisi ovlascen da koristis ovu komandu"); if(cuffed[playerid] == 1) return SCMF(playerid, 0xFF0000FF, "Ti posjedujes lisice na sebi i ne mozes koristiti ovu komandu"); if(sscanf(params, "ui", id)) return SCM(playerid, 0xFF0000FF, "Koristi: /rob [id]"); if(!IsPlayerConnected(id)) return SCM(playerid, 0xFF0000FF, "ID igraca koji ste unijeli nije online."); if(IsPlayerInAnyVehicle(id)) return SCMF(playerid, 0xFF0000FF, "Igrac %s(%d) je u vozilu i nemozes njega opljackati",GetName(id),id); if(IsPlayerInAnyVehicle(playerid)) return SCMF(playerid, 0xFF0000FF, "Ne mozes opljackati %s(%d) jer si u vozilu, napusti vozilo i pokusaj opet da ga opljackas",GetName(id),id); if(GetDistanceBetweenPlayers(playerid,id) > 3) return SCMF(playerid, 0xFF0000FF, "Igrac %s(%d) je suvise daleko od tebe, probaj mu se pribliziti i opljackati",GetName(id),id); if(Ulogiran[id] == 0) return SCMF(playerid, 0xFF0000FF, "Igrac %s(%d) je mrtav, nemozes ga opljackati",GetName(id),id); if(cuffed[id] == 1) return SCMF(playerid, 0xFF0000FF, "Igrac %s(%d) posjeduje lisice na sebi i nemozes ga opljackati",GetName(id),id); if(GetPlayerMoney(id) <= 100) return SCMF(playerid, 0xFF0000FF, "Igrac %s(%d) ne posjeduje dovoljno novca da bi ga mogao opljackati",GetName(id),id); if(beenrobbedrecently[id] >= 1) return SCMF(playerid, 0xFF0000FF, "Igrac %s(%d) je nedavno opljackan. Pricekaj pa pokusaj ponovo",GetName(id),id); new rname[24]; new vname[24]; GetPlayerName(playerid,rname, 24); GetPlayerName(id, vname, 24); new pcash = random(GetPlayerMoney(id)); format(string, sizeof(string), "%s(%d) Has robbed $%d from %s(%d)",rname,playerid,pcash,vname,id); printf("%s", string); GivePlayerMoney(playerid,pcash); GivePlayerMoney(id, -pcash); SendClientMessage(id, 0xA9A9A9AA, "|_Robbery Victim_|"); format(string, sizeof(string), "%s(%d) Has robbed $%d from you", rname,playerid,pcash); SendClientMessage(id, 0xD2691EAA, string); SendClientMessage(playerid, 0xA9A9A9AA, "|_Robbery Complete_|"); format(string, sizeof(string), "You have robbed $%d from %s(%d)", pcash,vname,id); SendClientMessage(playerid, 0x00C7FFAA, string); format(string, sizeof(string), "~w~Robbed by ~n~%s(%d)~n~$%d lost",rname,playerid,pcash); GameTextForPlayer(id,string,5000,3); oscore = GetPlayerScore(playerid); SetPlayerScore(playerid, oscore +1); format(string, sizeof(string), "~w~Robbed %s(%d)~n~$%d stolen",vname,id,pcash); GameTextForPlayer(playerid,string,5000,3); RobbedPlyRecent[playerid] =1; beenrobbedrecently[id] =120; new current_zone; current_zone = player_zone[playerid]; format(string, sizeof(string), "DISPATCH: (ROBBERY) Suspect: %s(%d) has robbed %s(%d) Location: %s",rname,playerid,vname,id,zones[current_zone][zone_name]); HITMANSCM(-1, string); if(gTeam[id] == TEAM_COP || gTeam[id] == TEAM_ARMY) { new plwl = GetPlayerWantedLevel(playerid); SetPlayerWantedLevel(playerid, plwl +4 ); } else{ new plwl = GetPlayerWantedLevel(playerid); SetPlayerWantedLevel(playerid, plwl +2 ); } new pcol = GetPlayerColor(playerid); new plwl = GetPlayerWantedLevel(playerid); SendClientMessage(playerid, 0xA9A9A9AA, "|_Crime Commited_|"); format(string, sizeof(string), "(ROBBERY) Wanted Level %d",plwl); SendClientMessage(playerid,pcol,string); GetPlayerWantedLevel(playerid, pcol); return 1; }
Код:
public WantedYellow() { for(new i = 0; i < MAX_PLAYERS; i++) { if(Ulogiran[i] == 1) { if(GetPlayerWantedLevel(i) >= 1 && GetPlayerWantedLevel(i) <= 3) { SetPlayerColor(i, COLOR_YELLOW); } } } } //------------------------------------------------------------------------------ public WantedOrange() { for(new i = 0; i < MAX_PLAYERS; i++) { if(Ulogiran[i] == 1) { if(GetPlayerWantedLevel(i) >= 4 && GetPlayerWantedLevel(i) <= 9) { SetPlayerColor(i, 0xFFA500AA); } } } } //------------------------------------------------------------------------------ public WantedRed() { for(new i = 0; i < MAX_PLAYERS; i++) { if(Ulogiran[i] == 1) { if(GetPlayerWantedLevel(i) >= 10) { SetPlayerColor(i, COLOR_RED); } } } }