Код:
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid,"InSniperDM") == 1)
{
SendClientMessage(playerid,COLOR_RED,"You will respawn in dm areas untill you type {FF0000}/leavedm");
GivePlayerWeapon(playerid,34,999999);
SetPVarInt(playerid,"InDeathMatch",1);
SetPVarInt(playerid,"InSniperDM",1);
new Random = random(sizeof(RandomSpawnsDM));
SetPlayerPos(playerid, RandomSpawnsDM[Random][0], RandomSpawnsDM[Random][1], RandomSpawnsDM[Random][2]);
return SetPlayerFacingAngle(playerid, RandomSpawnsDM[Random][3]);
}
if(GetPVarInt(playerid,"InBFDM") == 1)
{
SendClientMessage(playerid,COLOR_RED,"You will respawn in dm areas untill you type {FF0000}/leavedm");
GivePlayerWeapon(playerid,34,999999);
GivePlayerWeapon(playerid,26,999999);
GivePlayerWeapon(playerid,28,999999);
GivePlayerWeapon(playerid,24,999999);
SetPVarInt(playerid,"InDeathMatch",1);
SetPVarInt(playerid,"InBFDM",1);
new Random = random(sizeof(RandomSpawnsDMINBF));
SetPlayerPos(playerid, RandomSpawnsDMINBF[Random][0],RandomSpawnsDMINBF[Random][1], RandomSpawnsDMINBF[Random][2]);
return SetPlayerFacingAngle(playerid, RandomSpawnsDMINBF[Random][3]);
}
CMD:st1(playerid,params[])
{
if(GetPVarInt(playerid,"InSniperDM") == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR:You Cant Use This Command When You are In A Deathmatch");
if(GetPVarInt(playerid,"InDeathMatch") == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR:You Cant Use This Command When You are In A Deathmatch");
if (IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),-2967.3865,471.7879,4.9141);
SetVehicleZAngle(GetPlayerVehicleID(playerid),91.6934);
}
else
{
SetPlayerPos(playerid,-2967.3865,471.7879,4.9141);
SetPlayerFacingAngle(playerid, 91.6934);
}
SendClientMessage(playerid,COLOR_GREEN,"Welcome to Stuntrun 1{FFFF00}[/St1]");
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
return 1;
}