28.03.2014, 21:12
How can you make a /spec with last commands, and see how many money he or she gots on his/her self.
My spec is
My spec is
pawn Код:
CMD:spec(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(!strcmp(params, "off", true))
{
if(!Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You aren't spectating anybody.");
Spec[playerid] = 0;
TogglePlayerSpectating(playerid, 0);
GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
SendClientMessage(playerid, COLOR_WHITE, " You have stopped spectating players.");
if(PlayerInfo[Specid[playerid]][pAdmin] >= PlayerInfo[playerid][pAdmin])
{
format(string, sizeof(string), "SpecWarn: %s has stopped spectating you.", RPN(playerid));
SendClientMessage(Specid[playerid], COLOR_DARKRED, string);
}
Specid[playerid] = -1;
return 1;
}
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /spec [playerid]");
if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't spectate yourself.");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(Spec[playerb]) return SendClientMessage(playerid, COLOR_GREY, "Player is spectating someone.");
PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
if(Specid[playerid] != -1 && PlayerInfo[Specid[playerid]][pAdmin] > PlayerInfo[playerid][pAdmin])
{
format(string, sizeof(string), "SpecWarn: %s has stopped spectating you.", RPN(playerid));
SendClientMessage(Specid[playerid], COLOR_DARKRED, string);
}
if(!Spec[playerid])
{
PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
}
Specid[playerid] = playerb;
TogglePlayerSpectating(playerid, 1);
Spec[playerid] = 1;
SetPlayerInterior(playerid, GetPlayerInterior(playerb));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerb));
format(string, sizeof(string), " Currently spectating %s", RPN(playerb));
SendClientMessage(playerid, COLOR_WHITE, string);
if(IsPlayerInAnyVehicle(playerb))
{
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(playerb));
}
else
{
PlayerSpectatePlayer(playerid, playerb);
}
if(PlayerInfo[playerb][pAdmin] >= PlayerInfo[playerid][pAdmin])
{
format(string, sizeof(string), "SpecWarn: %s is currently spectating you.", RPN(playerid));
SendClientMessage(playerb, COLOR_DARKRED, string);
}
if(!PlayerInfo[playerb][pTutorial]) SendClientMessage(playerid, COLOR_WHITE, " That player is viewing the tutorial, don't assume he's using hacks yet.");
return 1;
}