SA-MP Forums Archive
Convert to zcmd? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Convert to zcmd? (/showthread.php?tid=299860)



Convert to zcmd? - remyguys - 27.11.2011

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


Re: Convert to zcmd? - Steven82 - 27.11.2011

Yes that line can. Next time try before asking.


Re: Convert to zcmd? - remyguys - 27.11.2011

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;




Re: Convert to zcmd? - Kostas' - 27.11.2011

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];



Re: Convert to zcmd? - remyguys - 27.11.2011

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.


Re: Convert to zcmd? - Kostas' - 27.11.2011

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


Re: Convert to zcmd? - remyguys - 27.11.2011

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.


Re: Convert to zcmd? - remyguys - 27.11.2011

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;




Re: Convert to zcmd? - Kostas' - 27.11.2011

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


Re: Convert to zcmd? - remyguys - 27.11.2011

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.