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=382593)
Help -
Rapk1d - 04.10.2012
So i have this
Код:
if(strcmp(cmd, "/derby", true) == 0)
{
if(derbyplaying == 1)
{
SendClientMessage(playerid, 0xB4B5B7AA, "The derby is already started");
return 1;
}
if(playerinminigame[playerid] == 1)
{
SendClientMessage(playerid, 0xB4B5B7AA, "You are already in a minigame");
return 1;
}
new pname[256];
GetPlayerName(playerid, pname, 256);
if(derbyon == 0)
{
derbyon = 1;
playerinminigame[playerid] = 1;
playerinderby[playerid] = 1;
derbyrank = 1;
SetPlayerInterior(playerid,15);
SetPlayerVirtualWorld(playerid,7);
SetVehicleVirtualWorld(bloodring[0],7);
bloodringfull[0] = 1;
PutPlayerInVehicle(playerid, bloodring[0], 0);
playerinbloodring[playerid] = 0;
TogglePlayerControllable(playerid, 0);
startvar[0] = 1;
dtimer = SetTimer("StartDerby", 60000, 0);
format(string, sizeof(string), "%s has started a derby, you have one minute to type /derby and join", pname);//
SendClientMessageToAll(0x33AA33AA,string);
return 1;
} else if(derbyon == 1 && derbyrank < 15) {
playerinminigame[playerid] = 1;
playerinderby[playerid] = 1;
derbyrank++;
SetPlayerInterior(playerid,15);
for(new i=0; i<15; i++)
{
if(bloodringfull[i] == 0)
{
SetPlayerVirtualWorld(playerid,7);
SetVehicleVirtualWorld(bloodring[i],7);
bloodringfull[i] = 1;
PutPlayerInVehicle(playerid, bloodring[i], 0);
TogglePlayerControllable(playerid, 0);
playerinbloodring[playerid] = i;
format(string, sizeof(string), "%s has joined the derby", pname);//
SendClientMessageToAll(0x33AA33AA,string);
return 1;
}
}
} else if(derbyon == 1 && derbyrank >= 15) {
format(string, sizeof(string), "The derby is full, wait for the next round", pname);//
SendClientMessage(playerid,0x33AA33AA,string);
return 1;
}
}
and i wanted to be enabled only by an admin/helper and closed by an admin/helper
somthing like this
Код:
if(strcmp(cmd, "/pdevent", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1 && (pdevent == 0) || PlayerInfo[playerid][pHelper] >= 1 && (pdevent == 0))
{
pdevent = 1;
BroadCast(COLOR_GREEN, " {FFFFFF}Purple dildo Event has been activated by an Admin ({24B200}/joinpdevent{FFFFFF})!");
}
else if (PlayerInfo[playerid][pAdmin] >= 1 && (pdevent == 1) || PlayerInfo[playerid][pHelper] >= 1 && (pdevent == 1))
{
pdevent = 0;
BroadCast(COLOR_GREEN, " Purple dildo Event has been disabled by an Admin!");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
}
return 1;
}
And to be able to join like this
Код:
if(strcmp(cmd, "/joinpdevent", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (pdevent == 1)
{
if (GetPlayerState(playerid) == 2)
{
SendClientMessage(playerid, COLOR_GRAD1, " Get out of your vehicle, and try again!");
return 1;
}
if(PlayerInfo[playerid][pJailed] == 1)
{
SendClientMessage(playerid,COLOR_GREY," You can`t use this command, you are in jail !");
return 1;
}
if(WantedLevel[playerid] >= 1)
{
SendClientMessage(playerid,COLOR_GREY," You can`t use this command, you are currently Wanted !");
return 1;
}
if(PlayerTied[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " you can`t use this command because you are tied!");
return 1;
}
/*else
{
SetPlayerPos(playerid, 1416.107000,0.268620,1000.926000);
}*/
new Random = random(30);
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
SendClientMessage(playerid, COLOR_GRAD1, " Ai fost teleportat la Purple dildo Event Arena!");
TogglePlayerControllable(playerid, 0);
SetPlayerInterior(playerid,1);
PlayerInfo[playerid][pInt] = 1;
SetPlayerVirtualWorld(playerid,0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 10, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " The Purple dildo Event is not activated at this time!");
}
}
return 1;
}
So ? some help please
Re: Help -
Rapk1d - 04.10.2012
up
Re: Help -
Red_Dragon. - 04.10.2012
Insert a variable in the command in which ADMINS or HELPERS only can do it like
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 1 // the one you made :D
Re: Help -
Rapk1d - 04.10.2012
i still dont ghet it....