if(strcmp(cmd, "/Sduty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFaction] == 8)
{
if PlayerToPoint( 5.0, playerid, 326.48, 307.37, 999.15 )
{
if(CopOnDuty[playerid] == 0)
{
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerActionMessage(playerid,15.0,"clocks in as a Sheriff, and takes his equipment from the locker");
}
else
{
PlayerActionMessage(playerid,15.0,"clocks in as a Sheriff, and takes her equipment from the locker");
}
SafeGivePlayerWeapon(playerid, 3, 0);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 41, 700);
CopOnDuty[playerid] = 1;
SetPlayerToFactionSkin(playerid);
SetPlayerToFactionColor(playerid);
format(string, sizeof(string), "[Sheriff:] %s is now an on duty as a Sheriff",GetPlayerNameEx(playerid));
SendFactionTypeMessage(1, COLOR_LSPD, string);
SafeGivePlayerWeapon(playerid, 3, 0);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 41, 700);
return 1;
}
else
{
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerActionMessage(playerid,15.0,"clocks out as a Sheriff, and puts his equipment in the locker");
}
else
{
PlayerActionMessage(playerid,15.0,"clocks out as a Sheriff, and puts her equipment in the locker");
}
CopOnDuty[playerid] = 0;
SetPlayerToFactionSkin(playerid);
SafeResetPlayerWeapons(playerid);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the duty position");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid faction");
return 1;
}
}
return 1;
}
error 001: expected token: "*then", but found "{"
if(IsPlayerInRangeOfPoint(playerid,range,Float: X,Float:Y,Float: Z);
if(PlayerToPoint(5.0, playerid, 326.48, 307.37, 999.15))
PlayerToPoint,
if(strcmp(cmd, "/Sduty", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pFaction] == 8) { if PlayerToPoint( 5.0, playerid, 326.48, 307.37, 999.15 ) { if(CopOnDuty[playerid] == 0) { if(PlayerInfo[playerid][pSex] == 1) { PlayerActionMessage(playerid,15.0,"clocks in as a Sheriff, and takes his equipment from the locker"); } else { PlayerActionMessage(playerid,15.0,"clocks in as a Sheriff, and takes her equipment from the locker"); } SafeGivePlayerWeapon(playerid, 3, 0); SafeGivePlayerWeapon(playerid, 24, 70); SafeGivePlayerWeapon(playerid, 41, 700); CopOnDuty[playerid] = 1; SetPlayerToFactionSkin(playerid); SetPlayerToFactionColor(playerid); format(string, sizeof(string), "[Sheriff:] %s is now an on duty as a Sheriff",GetPlayerNameEx(playerid)); SendFactionTypeMessage(1, COLOR_LSPD, string); SafeGivePlayerWeapon(playerid, 3, 0); SafeGivePlayerWeapon(playerid, 24, 70); SafeGivePlayerWeapon(playerid, 41, 700); return 1; } else { if(PlayerInfo[playerid][pSex] == 1){ // I moved this { to up there^ PlayerActionMessage(playerid,15.0,"clocks out as a Sheriff, and puts his equipment in the locker"); } else { PlayerActionMessage(playerid,15.0,"clocks out as a Sheriff, and puts her equipment in the locker"); } CopOnDuty[playerid] = 0; SetPlayerToFactionSkin(playerid); SafeResetPlayerWeapons(playerid); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the duty position"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid faction"); return 1; } } return 1; }
Originally Posted by Steven82
Код:
PlayerToPoint, http://wiki.sa-mp.com it would work, usually playertopoint is used for switching interior's. EDIT: Код:
if(strcmp(cmd, "/Sduty", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pFaction] == 8) { if PlayerToPoint( 5.0, playerid, 326.48, 307.37, 999.15 ) { if(CopOnDuty[playerid] == 0) { if(PlayerInfo[playerid][pSex] == 1) { PlayerActionMessage(playerid,15.0,"clocks in as a Sheriff, and takes his equipment from the locker"); } else { PlayerActionMessage(playerid,15.0,"clocks in as a Sheriff, and takes her equipment from the locker"); } SafeGivePlayerWeapon(playerid, 3, 0); SafeGivePlayerWeapon(playerid, 24, 70); SafeGivePlayerWeapon(playerid, 41, 700); CopOnDuty[playerid] = 1; SetPlayerToFactionSkin(playerid); SetPlayerToFactionColor(playerid); format(string, sizeof(string), "[Sheriff:] %s is now an on duty as a Sheriff",GetPlayerNameEx(playerid)); SendFactionTypeMessage(1, COLOR_LSPD, string); SafeGivePlayerWeapon(playerid, 3, 0); SafeGivePlayerWeapon(playerid, 24, 70); SafeGivePlayerWeapon(playerid, 41, 700); return 1; } else { if(PlayerInfo[playerid][pSex] == 1){ // I moved this { to up there^ PlayerActionMessage(playerid,15.0,"clocks out as a Sheriff, and puts his equipment in the locker"); } else { PlayerActionMessage(playerid,15.0,"clocks out as a Sheriff, and puts her equipment in the locker"); } CopOnDuty[playerid] = 0; SetPlayerToFactionSkin(playerid); SafeResetPlayerWeapons(playerid); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the duty position"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid faction"); return 1; } } return 1; } |
Originally Posted by Kevin Fallow / KevKo
No, this would be correct.
pawn Код:
|