Basic Question Here:
#1

Hello, how I can do this:

If I kill someone get a wanted star, and if i kill him again get 2 stars and if i kill him again 3 stars and all like that.
Reply
#2

pawn Код:
SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
Reply
#3

And how about this:

If the player is between skins 280 & 288 Send a message saying "You are now a police"
Reply
#4

pawn Код:
if(GetPlayerSkin(playerid) >= 280 || <= 288)return SendClientMessage(playerid,-1,"You are now a police.");// -1 is white.
Reply
#5

Quote:
Originally Posted by Tee
Посмотреть сообщение
pawn Код:
if(GetPlayerSkin(playerid) >= 280 || <= 288)return SendClientMessage(playerid,-1,"You are now a police.");// -1 is white.
Your code will be valid for all skins, as it checks if the skin is above ID 280 OR below ID 288.

Here is the corrected version:
pawn Код:
if( GetPlayerSkin( playerid ) >= 280 && GetPlayerSkin( playerid ) <= 288 )
   return SendClientMessage( playerid, 0xFF0000FF, "You are now a police officer!" );
Reply
#6

When I do /kill it sends the "the killer is now in the police list" message, how i can do that just when he gets killer send that message to him?
Reply
#7

I suggest you study the OnPlayerDeath callback more closely.

In order to accomplish this, you'll have to take use of the killerid parameter:
pawn Код:
public OnPlayerDeath( playerid, killerid, reason ) {

   if( GetPlayerSkin( killerid ) >= 280 && GetPlayerSkin( killerid ) <= 288 ) {
      return SendClientMessage( playerid, 0xFF0000FF, "You are now a police officer!" );
   }
   
   return 1;
}
Reply
#8

Look this is my hole code:

pawn Код:
/*********************************
        -COLORS-                 *
**********************************/

#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_ALLDEPT 0xFF8282AA
//********************************
//********************************


#define FILTERSCRIPT

#include <a_samp>

public OnFilterScriptInit()
{
    print("-Wanted Script -                     LOADED");
    return 1;
}

public OnFilterScriptExit()
{
    print("-Wanted Script -                   UNLOADED");
    return 1;
}
public OnPlayerConnect(playerid)
{
    SetPlayerWantedLevel(playerid, 0);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SetPlayerWantedLevel(playerid, 0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if( GetPlayerSkin( playerid ) >= 280 && GetPlayerSkin( playerid ) <= 288 )
    return SendClientMessage( playerid, 0xFF0000FF, "You are now a police officer!" );

    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendClientMessage(playerid, COLOR_GRAD3, "Your killer is now a wanted suspect from the Police!");
    SendClientMessage(killerid, COLOR_GRAD3, "You're now a wanted suspect from the Police!");
    SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
    return 1;
}
Im basically starting a wanted system, when you get killed you get a message "your killer is not on the wanted police list" and when you kill someone it says you are not wanted and gives you a star, but what happens its that when i do /kill it says you are not wanted.
Reply
#9

I'm not going to give you the direct code if your not even willing to try and figure it out for yourself. Like I said in my previous post, look up OnPlayerDeath callback.

Here is a direct link: https://sampwiki.blast.hk/wiki/OnPlayerDeath
Reply
#10

Sorry, I read it as, skins between 280 and 288. I did not read it as 280 and 288.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)