Wanted Help
#1

so i want so i do /suspect [playerid/PartOfName] [wantedlevel] [rreson]

so i do for ex:/suspect 0 2 test
so i have wanted 2 and if i do /suspect 0 2 test again i have wanted 2..i want for them to add

so /suspect 0 2 test + /suspect 0 2 test = wanted 4..

and


I want here so if i kill a person to add..i kill a person i get wanted 3 i kill another person i have wanted 6 because 3+3=6.

PHP код:
if (gTeam[killerid] >= 3)
                    {
                        
WantedPoints[killerid] += 3;
                          
WantedLevel[killerid] = 3;
                          
SetPlayerWantedLevel(playerid3);
                        if(
reason != 49)
                        {
                            
SetPlayerCriminal(killerid,255"First Degree Murder");
                        }
                        else if (
reason == 49)
                        {
                            
SetPlayerCriminal(killerid,255"Hit si Run");
                        }
                    } 
ALL REP!!
Reply
#2

Use sscanf and SetPlayerWantedLevel
Reply
#3

PHP код:
if(strcmp(cmd"/suspect"true) == || strcmp(cmd"/su"true) == 0)
                    {
                    if(
IsPlayerConnected(playerid))
                    {
                    
tmp strtok(cmdtextidx);
                    if(!
strlen(tmp))
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /(su)spect [playerid/PartOfName] [wantedlevel] [motiv]");
                        return 
1;
                    }
                    new 
playa;
                    new 
money;
                    
playa ReturnUser(tmp);
                    
tmp strtok(cmdtextidx);
                    
money strval(tmp);
                    if (
IsACop(playerid))
                    {
                        if(
IsPlayerConnected(playa))
                        {
                            if(
playa != INVALID_PLAYER_ID)
                            {
                                new 
length strlen(cmdtext);
                                while ((
idx length) && (cmdtext[idx] <= ' '))
                                {
                                    
idx++;
                                }
                                new 
offset idx;
                                new 
result[64];
                                while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                                {
                                    
result[idx offset] = cmdtext[idx];
                                    
idx++;
                                }
                                
result[idx offset] = EOS;
                                if(!
strlen(result))
                                {
                                    
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /(su)spect [playerid/PartOfName] [wlevel] [motiv]");
                                    return 
1;
                                  }
                                if (
gTeam[playa] == || IsACop(playa))
                                {
                                    
SendClientMessage(playeridCOLOR_WHITE"You can't suspect cops!");
                                    return 
1;
                                }
                                if(
money 10)
                                {
                                    
SendClientMessage(playeridCOLOR_WHITE"Wanted Level must be between 1 si 10 !");
                                    return 
1;
                                }
                                if(
money == 0)
                                {
                                    
SendClientMessage(playeridCOLOR_WHITE"Wanted Level must be between 1 si 10 !");
                                    return 
1;
                                }
                                new 
string1[128];
                                
GetPlayerName(playagiveplayersizeof(giveplayer));
                                
GetPlayerName(playeridsendernamesizeof(sendername));
                                
WantedPoints[playa] = money;
                                
WantedLevel[playa] = money;
                                
format(stringsizeof(string), "You've commited a Crime ( %s ). Reporter: %s.",result,sendername);
                                
SendClientMessage(playaCOLOR_LIGHTREDstring);
                                
format(string1sizeof(string1), "Current Wanted Level: %d"money);
                                
SendClientMessage(playaCOLOR_YELLOWstring1);
                                for(new 
0MAX_PLAYERSi++)
                                {
                                    if(
IsPlayerConnected(i))
                                    {
                                        if(
PlayerInfo[i][pMember] == 1||PlayerInfo[i][pLeader] == 1||PlayerInfo[i][pMember] == 2||PlayerInfo[i][pLeader] == 2||PlayerInfo[i][pMember] == 3||PlayerInfo[i][pLeader] == 3)
                                        {
                                            
format(stringsizeof(string), "HQ: All Units APB: Reporter: %s",sendername);
                                            
SendClientMessage(iTEAM_BLUE_COLORstring);
                                            
format(stringsizeof(string), "HQ: Crime: %s, Suspect: %s, WantedLevel: %d",result,giveplayer,money);
                                            
SendClientMessage(iTEAM_BLUE_COLORstring);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_WHITE"You are not a Cop !");
                    }
                    }
                    return 
1;
                    } 
Reply
#4

Код:
	if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /(su)spect [PlayerID/PartOfName] [WantedLevel] [Reason]");
            new playa;
            new money;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            money = strval(tmp);
            if (IsACop(playerid))
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        result[0] = toupper(result[0]);
                        if(!strlen(result)) return SendClientMessage(playerid, -1, "USAGE: /(su)spect [PlayerID/PartOfName] [WantedLevel] [Reason]");
                        if (gTeam[playa] == 2 || IsACop(playa)) return SendClientMessage(playerid, -1, "You can't Suspect a Cop!");
                        if(PlayerInfo[playa][pJailed] == 1 || PlayerInfo[playa][pJailed] == 2) return SendClientMessage(playerid, COLOR_WHITE, "You can't suspect a jailed player");
                        if(money > 10) return SendClientMessage(playerid, COLOR_GREY, "Maximum wanted level is 10!");
                        if(money == 0) return SendClientMessage(playerid, COLOR_GREY, "Minimum wanted level is 0!");
                        if(PlayerInfo[playa][pWanted] > 9) return SendClientMessage(playerid, COLOR_GREY, "That player have Maxim Wanted Level! (Wanted 10)");
                        format(string, sizeof(string), "Thay player have Wanted %d , give him a lower wanted level", PlayerInfo[playa][pWanted]);
                        if(PlayerInfo[playa][pWanted] + money > 10) return SendClientMessage(playerid, COLOR_GREY, string);
                        PlayerInfo[playa][pWanted] += money;
	                    new wl = PlayerInfo[playa][pWanted];
						SetPlayerWantedLevel(playa, wl);
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "You commited a crime ( %s ) [+%d],Raportat de: %s",result,money,sendername);
                        SendClientMessage(playa, COLOR_LIGHTRED, string);
                        for(new i = 0; i < MAX_PLAYERS; i++)
                        {
                            if(IsPlayerConnected(i))
                            {
                                if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pLeader] == 2 || PlayerInfo[i][pMember] == 3 || PlayerInfo[i][pLeader] == 3)
                                {
                                    format(string, sizeof(string), "HQ: All units APB: Reporter: %s.",sendername);
                                    SendClientMessage(i, 0x0000C1FF, string);
                                    format(string, sizeof(string), "HQ: Crime: %s[+%d], Suspect: %s. ",result,money,giveplayer);
                                    SendClientMessage(i, 0x0000C1FF, string);
                                }
                            }
                        }
                    }
                }
            } else return SendClientMessage(playerid, COLOR_GREY, "You are not a Cop!");
        }
        return 1;
    }
try this work 99%
Reply
#5

and if i kill a person i want to add there too..
Reply
#6

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
      
SetPlayerWantedLevel(killerid1);
return 
1;

Works?
Reply
#7

no man..i want suspect thingy...
Reply
#8

on tab public OnPlayerDeath(playerid, killerid, reason)
you add this http://pastebin.com/kq61VHYU Original by ZyGhy
Reply
#9

i killed a cop..and he gave me w2..so killing a cop is w2..if i give him su 2 supposed to have 3 stars..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)