.::Moving gate with only one skin::.
#1

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(9692231.45703, -2212.4411612.531810.000000.00000, -45.00000);
//the skins i want the command to work for
    //Maffia
    
AddPlayerClass(462128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
    
AddPlayerClass(592128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
    
AddPlayerClass(1112128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
    
AddPlayerClass(1242128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
    
AddPlayerClass(1252128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
    
AddPlayerClass(2232128.0320,-2271.5474,20.6719,235.8931,0,0,0,0,0,0);
    return 
1;
}
//the gate code
//gate1
CMD:closegate(playeridparams[])
{
    
MoveObject(gate12231.45703, -2212.4411612.531811);
    
SendClientMessage(playerid0xEF994300"Closeing Maffia HQ...");
    return 
1;
}
CMD:opengate(playeridparams[])
{
    
MoveObject(gate12231.4570, -2212.44129.32411);
    
SendClientMessage(playerid0xEF994300"Opening Maffia HQ...");
    return 
1;

please help thank you so much!!
Reply
#2

Just add
pawn Код:
if(GetPlayerSkin(playerid)==whichoneyouwant)
Reply
#3

where do i add it ?
Reply
#4

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
Reply
#5

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.
Reply
#6

Show me line 239 and 599
Reply
#7

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);
Reply
#8

Fixed line 599

if(GetPlayerSkin(playerid) == 43) return SendClientMessage(playerid, -1, "welcome");
Reply
#9

so for every skin i want to us command i do

if(GetPlayerSkin(playerid) == SkinIDHere) return SendClientMessage(playerid, -1"Your Message Here");
Reply
#10

No. You are missin a coma, after the -1 add ' , '
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)