06.04.2012, 15:28
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?
but only skin 285 should be able to move it anyway i can do that?
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
}
Somewhere in your command you would add an if statement to see if he is in skin 285.
Example 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;
}
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;
}
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..
Код:
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; } |