help - 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: help (
/showthread.php?tid=331926)
help -
Anup_Rao - 06.04.2012
I have made a gate it moves properly when i use a cmd
but only skin 285 should be able to move it anyway i can do that?
Re: help -
ReneG - 06.04.2012
Somewhere in your command you would add an if statement to see if he is in skin 285.
Example
pawn Код:
CMD:gate(playerid,params[])
{
if(GetPlayerSkin(playerid) != 285)
{
SendClientMessage(playerid,-1,"You are not allowed to open this gate.");
return 1;
}
// rest of command here
}
Re: help -
Anup_Rao - 06.04.2012
Quote:
Originally Posted by VincentDunn
Somewhere in your command you would add an if statement to see if he is in skin 285.
Example
pawn Код:
CMD:gate(playerid,params[]) { if(GetPlayerSkin(playerid) != 285) { SendClientMessage(playerid,-1,"You are not allowed to open this gate."); return 1; } // rest of command here }
|
pawn Код:
if (strcmp("/ogs", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) != 285)
{
MoveObject(gate, 2497.50, 2785.44, 11.27,3);
else
SendClientMessage(playerid, 0xAFAFAFAA,"i will put my text here");
return 1;
}
i did this but u see it gives me errors i want only id 285 to be able to open the gate so please make another pawn code and paste it in a reply like make the whole command see whats wrong with mine only 285 should be able to open the gate please help
Re: help -
ReneG - 06.04.2012
Try this, your indentation was off, and your code was wrong.
pawn Код:
if (strcmp("/ogs", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) != 285)
{
SendClientMessage(playerid, 0xAFAFAFAA,"i will put my text here");
return 1;
}
else
{
MoveObject(gate, 2497.50, 2785.44, 11.27,3);
}
return 1;
}
Re: help -
$$inSane - 06.04.2012
Quote:
if (strcmp("/opengates", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) != 285)
{
SendClientMessage(playerid, 0xAFAFAFAA,"Opening Gates.");
MoveObject(gate, 2497.50, 2785.44, 11.27,3);
return 1;
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA,"You are not allowed to move the gates");
}
return 1;
}
|
its the code..
Re: help -
TzAkS. - 06.04.2012
Quote:
Originally Posted by $$inSane
its the code..
Код:
if (strcmp("/opengates", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) != 285)
{
SendClientMessage(playerid, 0xAFAFAFAA,"Opening Gates.");
MoveObject(gate, 2497.50, 2785.44, 11.27,3);
return 1;
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA,"You are not allowed to move the gates");
}
return 1;
}
|
If you see that 2 guys helped him,why are you posting?
With your code,will open the gate if he is not with skin 285,
!= 285 Not equal.
Re: help -
Anup_Rao - 07.04.2012
THX BOTH OF YOU