wanted event
#1

when admins do it it give the wanted to the id 0 not to the requirement id.
Код:
CMD:setwanted(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 3)
    {
        new tmp[256], tmp2[256], Index, player1 = strval(tmp), Float:x, Float:y, Float:z, Float:angle; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
        if(isnull(tmp)) return SendClientMessage(playerid, red, "USAGE:/setwanted [playerid]");
        SendClientMessageToAll(TEAM_Wanted_COLOR, "NOTABLE:Kill The Black Blip And Earn To Yourself a Prize.");
        SetPlayerTeam(player1, TEAM_Wanted);
   	    SetPlayerColor(player1, TEAM_Wanted_COLOR);
        SetPlayerHealth(player1, 100);
        SetPlayerArmour(player1, 100);
  	    ResetPlayerWeapons(player1);
        GetPlayerPos(player1,x, y, z);
        CreateVehicle(468, x, y, z, angle, 0, 1, 60);
        Update3DTextLabelText(RankLabel[player1], 0xFFFFFFFF, " ");
        gTeam[player1] = TEAM_Wanted;
	}else return SendClientMessage(playerid, red, "ERROR:You need to be admin to use this command!");
    return 1;
}
Reply
#2

pawn Код:
tmp = strtok(params,Index),
Should that last comma be a semicolon?
Reply
#3

how?? , I can't Understand you please explain more
Reply
#4

Should this :
Quote:

tmp = strtok(params,Index),

be this :
Quote:

tmp = strtok(params,Index);

?
Reply
#5

no, it shouldn't
Reply
#6

You are putting:
pawn Код:
player1 = strval(tmp)
Before:
pawn Код:
tmp = strtok(params,Index)
Meaning that 'strval(tmp)' == 0. (No value)

Fixed command:
pawn Код:
CMD:setwanted(playerid, params[])
{
    if(PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid, red, "ERROR:You need to be admin to use this command!");
    new tmp[256], tmp2[256], Index, Float:x, Float:y, Float:z, Float:angle;
    tmp = strtok(params, Index), tmp2 = strtok(params, Index);
    if(isnull(tmp)) return SendClientMessage(playerid, red, "USAGE:/setwanted [playerid]");
    new player1 = strval(tmp)
    if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "Player not connected.");
    SendClientMessageToAll(TEAM_Wanted_COLOR, "NOTABLE: Kill The Black Blip And Earn To Yourself a Prize.");
    SetPlayerTeam(player1, TEAM_Wanted);
    SetPlayerColor(player1, TEAM_Wanted_COLOR);
    SetPlayerHealth(player1, 100);
    SetPlayerArmour(player1, 100);
    ResetPlayerWeapons(player1);
    GetPlayerPos(player1, x, y, z);
    GetPlayerFacingAngle(player1, angle);
    new veh = CreateVehicle(468, x, y, z, angle, 0, 1, 60);
    PutPlayerInVehicle(veh, 0);
    Update3DTextLabelText(RankLabel[player1], 0xFFFFFFFF, " ");
    gTeam[player1] = TEAM_Wanted;
    return 1;
}
Reply
#7

BenzoAMG REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)