#1

Guys i want to make something first here is the command
PHP код:
CMD:arrest(playerid,params[])
{
        new 
time,reason[100],str1[256];
        new 
str[256];
        if(
PInfo[playerid][pCop] >= 3)
        if(
sscanf(params,"dds",id,time,reason)) return SendClientMessage(playeridCOLOR_GREY"-- Server: {USAGE} /arrest <playerid> <time> <reason>");
        if (!
IsPlayerConnected(id)) return SendClientMessage(playeridCOLOR_GREY"-- Server: {ERROR} Player is not connected.");
        if(
IsPlayerInRangeOfPoint(playerid,3.0,268.3070,77.8721,1001.0391,359.2793))
        
format(strsizeof(str), "Officer %s has arrested %s for %d minutes; RP Reason: %s",PlayerName(playerid), PlayerName(id), timereason);
        
SendClientMessageToAll(COLOR_GREY,str);
        
SetPlayerInterior(id6);
            
SetPlayerVirtualWorld(id0);
        
SetPlayerFacingAngle(id360.0);
        
SetPlayerPos(id,264.3290,82.2896,1001.0391);
        
SetPlayerHealth(id100.0);
        
ResetPlayerWeapons(id);
        
SetTimerEx("Unjail",time*60000false"i"id);
        return 
1;

And i want to add this
PHP код:
if( GetPlayerSkin (playerid) == id) { 
But not only one id i want to add 4 or 5 how can i make this ??
Reply
#2

Add to the conditional statement a another check by seperating each conditional statement with || or &&
like so
pawn Код:
if(GetPlayerSkin (playerid) == 4 || GetPlayerSkin (playerid) == 5)
This will check if the player skin id equals to 4 OR to 5

|| is OR
&& is AND
So when you use
skin==4 || skin==5
it means if the skin equals to 4 or skin equals to 5 then do this

using && instead of || will change the condition from OR to AND

you can add as many conditions as you want as long as you seperate them by the OR || gate or AND && gate
Reply
#3

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
Add to the conditional statement a another check by seperating each conditional statement with || or &&
like so
pawn Код:
if(GetPlayerSkin (playerid) == 4 || GetPlayerSkin (playerid) == 5)
This will check if the player skin id equals to 4 OR to 5

|| is OR
&& is AND
So when you use
skin==4 || skin==5
it means if the skin equals to 4 or skin equals to 5 then do this

using && instead of || will change the condition from OR to AND

you can add as many conditions as you want as long as you seperate them by the OR || gate or AND && gate
Rep++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)