Convert to zcmd?
#1

Hello,

I need this line to be able to be used in a zcmd script:
PHP код:
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == || PlayerInfo[playerid][pAdmin] >= 1
This is what i need it for:

PHP код:
CMD:operation(playeridparams[])
{
    new 
id;
    if(
sscanf(params"d"id)) return SendClientMessage(playerid0xffffffff"[Usage]: /operation <playerid>");
    if(
gTeam[playerid] != TEAM_MEDIC) return SendClientMessage(playerid0xffffffff"You're not medic!");
    if(
id == INVALID_PLAYER_ID) return SendClientMessage(playerid0xffffffff"Invalid playerid!");
    if(!
Injured[id]) return SendClientMessage(playerid0xffffffff"This person isn't injured!");
    
TogglePlayerControllable(id0);
    
TogglePlayerControllable(playerid0);
    
SendClientMessage(id0xffffffff"A medic started to operate you!");
    
SendClientMessage(playerid0xffffffff"You started an operation!");
    
SetTimerEx("OperationFinish"1800000"dd"playeridid);
    return 
1;

Thx in advance
Reply
#2

Yes that line can. Next time try before asking.
Reply
#3

Tried that. Its a FS btw.

(95) : error 017: undefined symbol "PlayerInfo"
(95) : warning 215: expression has no effect
(95) : error 001: expected token: ";", but found "]"
(95) : error 029: invalid expression, assumed zero

PHP код:
CMD:operation(playeridparams[])
{
    new 
id;
    if(
sscanf(params"d"id)) return SendClientMessage(playerid0xffffffff"[Usage]: /operation <playerid>");
    if(
PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == || PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid0xffffffff"You're not medic!");
    if(
id == INVALID_PLAYER_ID) return SendClientMessage(playerid0xffffffff"Invalid playerid!");
    if(!
Injured[id]) return SendClientMessage(playerid0xffffffff"This person isn't injured!");
    
TogglePlayerControllable(id0);
    
TogglePlayerControllable(playerid0);
    
SendClientMessage(id0xffffffff"A medic started to operate you!");
    
SendClientMessage(playerid0xffffffff"You started an operation!");
    
SetTimerEx("OperationFinish"1800000"dd"playeridid);
    return 
1;

Reply
#4

Quote:
Originally Posted by remyguys
Посмотреть сообщение
Tried that.

(95) : error 017: undefined symbol "PlayerInfo"
(95) : warning 215: expression has no effect
(95) : error 001: expected token: ";", but found "]"
(95) : error 029: invalid expression, assumed zero

PHP код:
CMD:operation(playeridparams[])
{
    new 
id;
    if(
sscanf(params"d"id)) return SendClientMessage(playerid0xffffffff"[Usage]: /operation <playerid>");
    if(
PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == || PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid0xffffffff"You're not medic!");
    if(
id == INVALID_PLAYER_ID) return SendClientMessage(playerid0xffffffff"Invalid playerid!");
    if(!
Injured[id]) return SendClientMessage(playerid0xffffffff"This person isn't injured!");
    
TogglePlayerControllable(id0);
    
TogglePlayerControllable(playerid0);
    
SendClientMessage(id0xffffffff"A medic started to operate you!");
    
SendClientMessage(playerid0xffffffff"You started an operation!");
    
SetTimerEx("OperationFinish"1800000"dd"playeridid);
    return 
1;

Is your variable ?
pawn Код:
new PlayerInfo[MAX_PLAYERS][Your_Enum];
Reply
#5

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
Is your variable ?
pawn Код:
new PlayerInfo[MAX_PLAYERS][Your_Enum];
That line isnt in the FS, if i add it more errors.
Reply
#6

Dude, you just added on your command
pawn Код:
PlayerInfo
Do you have it in a variable?
And your enum
pawn Код:
enum Your_Enum
{
    pFaction,
};
Show me the first lines, if you don't mind
Reply
#7

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
Dude, you just added on your command
pawn Код:
PlayerInfo
Do you have it in a variable?
Probably not in the FS

sorry im no pro/advanced scripter.
Reply
#8

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define FILTERSCRIPT
#define TEAM_MEDIC      0

static gTeam[MAX_PLAYERS];

new 
bool:Injured[MAX_PLAYERS];
new 
DeathTimer[MAX_PLAYERS];
new 
RecoveryTimer[MAX_PLAYERS] = -1;

public 
OnFilterScriptInit()
{
    
SetTimer("HealthChecker"10001);
    return 
1;

Reply
#9

God!
You added something you found and thats it?
pawn Код:
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 3 || PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, 0xffffffff, "You're not medic!");
You don't have any variables, enums with pFaction, pAdmin
Reply
#10

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
God!
You added something you found and thats it?
pawn Код:
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 3 || PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, 0xffffffff, "You're not medic!");
You don't have any variables, enums with pFaction, pAdmin
I got that line from my GM.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)