.::Moving gate with only one skin::. -
LavaHDProkiller - 02.03.2013
Hello fellow scripts i have maked a moving gate thanks to skillzz but i want only one kind of skin to open the base doors this is the code for my maffia base. Where it says //maffia they the skin i just want the command to work for.
The gate and skin code
PHP код:
new gate1;
public OnGameModeInit()
{
gate1 = CreateObject(969, 2231.45703, -2212.44116, 12.53181, 0.00000, 0.00000, -45.00000);
//the skins i want the command to work for
//Maffia
AddPlayerClass(46, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(59, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(111, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(124, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(125, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(223, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
return 1;
}
//the gate code
//gate1
CMD:closegate(playerid, params[])
{
MoveObject(gate1, 2231.45703, -2212.44116, 12.53181, 1);
SendClientMessage(playerid, 0xEF994300, "Closeing Maffia HQ...");
return 1;
}
CMD:opengate(playerid, params[])
{
MoveObject(gate1, 2231.4570, -2212.4412, 9.3241, 1);
SendClientMessage(playerid, 0xEF994300, "Opening Maffia HQ...");
return 1;
}
please help thank you so much!!
Re: .::Moving gate with only one skin::. -
dusk - 02.03.2013
Just add
pawn Код:
if(GetPlayerSkin(playerid)==whichoneyouwant)
Re: .::Moving gate with only one skin::. -
LavaHDProkiller - 02.03.2013
where do i add it ?
Re: .::Moving gate with only one skin::. - Patrick - 02.03.2013
try this
pawn Код:
new gate1;
public OnGameModeInit()
{
gate1 = CreateObject(969, 2231.45703, -2212.44116, 12.53181, 0.00000, 0.00000, -45.00000);
//the skins i want the command to work for
//Maffia
AddPlayerClass(46, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(59, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(111, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(124, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(125, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
AddPlayerClass(223, 2128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
return 1;
}
//the gate code
//gate1
CMD:closegate(playerid, params[])
{
if(GetPlayerSkin(playerid) == SkinIDHere) return SendClientMessage(playerid, -1"Your Message Here");
MoveObject(gate1, 2231.45703, -2212.44116, 12.53181, 1);
SendClientMessage(playerid, 0xEF994300, "Closeing Maffia HQ...");
return 1;
}
CMD:opengate(playerid, params[])
{
if(GetPlayerSkin(playerid) == SkinIDHere) return SendClientMessage(playerid, -1"Your Message Here");
MoveObject(gate1, 2231.4570, -2212.4412, 9.3241, 1);
SendClientMessage(playerid, 0xEF994300, "Opening Maffia HQ...");
return 1;
}
PS: Change the SkinIDHere to the skin id that you want to put
Re: .::Moving gate with only one skin::. -
LavaHDProkiller - 02.03.2013
C:\Users\Dan\Desktop\My GTA SAMP 0.3x\gamemodes\newtest.pwn(239) : warning 217: loose indentation
C:\Users\Dan\Desktop\My GTA SAMP 0.3x\gamemodes\newtest.pwn(243) : warning 217: loose indentation
C:\Users\Dan\Desktop\My GTA SAMP 0.3x\gamemodes\newtest.pwn(544) : error 001: expected token: ",", but found "-string-"
C:\Users\Dan\Desktop\My GTA SAMP 0.3x\gamemodes\newtest.pwn(544) : warning 215: expression has no effect
C:\Users\Dan\Desktop\My GTA SAMP 0.3x\gamemodes\newtest.pwn(544) : error 001: expected token: ";", but found ")"
C:\Users\Dan\Desktop\My GTA SAMP 0.3x\gamemodes\newtest.pwn(544) : error 029: invalid expression, assumed zero
C:\Users\Dan\Desktop\My GTA SAMP 0.3x\gamemodes\newtest.pwn(544) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: .::Moving gate with only one skin::. - Patrick - 02.03.2013
Show me line
239 and
599
Re: .::Moving gate with only one skin::. -
LavaHDProkiller - 02.03.2013
line 599
if(GetPlayerSkin(playerid) == 43) return SendClientMessage(playerid, -1"welcome");
line 239
gate1 = CreateObject(969, 2231.45703, -2212.44116, 12.53181, 0.00000, 0.00000, -45.00000);
Re: .::Moving gate with only one skin::. -
Denying - 02.03.2013
Fixed line 599
if(GetPlayerSkin(playerid) == 43) return SendClientMessage(playerid, -1, "welcome");
Re: .::Moving gate with only one skin::. -
LavaHDProkiller - 02.03.2013
so for every skin i want to us command i do
if(GetPlayerSkin(playerid) == SkinIDHere) return SendClientMessage(playerid, -1"Your Message Here");
Re: .::Moving gate with only one skin::. -
Denying - 02.03.2013
No. You are missin a coma, after the -1 add ' , '