CMD:skin(playerid, params[]) { PlayerInfo[playerid][pSkin] = 1; SetPlayerSkin(playerid, 3); SendClientMessage(playerid, COLOR_GOLD, "Skin changed"); return 1; }
CMD:adminduty(playerid, params[]) { if(PlayerData[ID][AdminLevel] >= 1) { if(AdminDuty[playerid]) //if they are already in admin duty { AdminDuty[playerid] = false; //Set the AdminDuty variable to false SetPlayerHealth(playerid,100); SetPlayerArmour(playerid,0); SetPlayerColor(playerid, 0xFFFFFFFF); //Set their color to white GetPlayerSkin(playerid); SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!"); //Inform them about the duty change } else //If they are not on admin duty { AdminDuty[playerid] = true; //Set the AdminDuty variable to true SetPlayerHealth(playerid,99999); SetPlayerArmour(playerid,99999); SetPlayerSkin(playerid,82); SetPlayerColor(playerid, 0xFF0000FF); //Set their color to red SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!"); //Inform them about the duty change } } else return SendClientMessage(playerid, COLOR_RED, "You have to be level 1 to use this command!"); //if he isn't allowed to use this command, send him this message return 1; }
new OldSkin = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, OldSkin);
put this when player is on duty code
remove that GetPlayerSkin and replace with this pawn Код:
pawn Код:
|
CMD:adminduty(playerid, params[])
{
if(PlayerData[ID][AdminLevel] >= 1)
{
if(AdminDuty[playerid] == 0) //if admin is off duty
{
AdminDuty[playerid] = 1;
SetPlayerHealth(playerid,99999);
SetPlayerArmour(playerid,99999);
new OldSkin = GetPlayerSkin(playerid);
SetPlayerSkin(playerid,82);
SetPlayerColor(playerid, 0xFF0000FF);
SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!");
}
else if(AdminDuty[playerid] == 1) //if admin is on duty
{
AdminDuty[playerid] = 0;
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
SetPlayerColor(playerid, 0xFFFFFFFF);
SetPlayerSkin(playerid, OldSkin);
SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!");
}
}
else return SendClientMessage(playerid, COLOR_RED, "You have to be level 1 to use this command!"); //if he isn't allowed to use this command, send him this message
return 1;
}
first off all i'm getting crazy on your code so i make it simple
pawn Код:
|
error 017: undefined symbol "OldSkin"
SetPlayerSkin(playerid, OldSkin);
SetPVarInt(playerid, "OldSkin", GetPlayerSkin(playerid)); //replace new OldSkin with this
SetPlayerSkin(playerid, GetPVarInt(playerid, "OldSkin"));
CMD:adminduty(playerid, params[])
{
if(PlayerData[ID][AdminLevel] == 0) return SendClientMessage(playerid, COLOR_RED, "You have to be level 1 to use this command!"); //if he isn't allowed to use this command, send him this message
if(AdminDuty[playerid]) //if they are already in admin duty
{
AdminDuty[playerid] = false; //Set the AdminDuty variable to false
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 0.0);
SetPlayerColor(playerid, 0xFFFFFFFF); //Set their color to white
SetPVarInt(playerid, "AD_Skin", GetPlayerSkin(playerid));
SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!"); //Inform them about the duty change
}
else //If they are not on admin duty
{
AdminDuty[playerid] = true; //Set the AdminDuty variable to true
SetPlayerHealth(playerid, 99999.0);
SetPlayerArmour(playerid, 99999.0);
SetPlayerSkin(playerid, GetPVarInt(playerid, "AD_Skin"));
DeletePVar(playerid, "AD_Skin");
SetPlayerColor(playerid, 0xFF0000FF); //Set their color to red
SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!"); //Inform them about the duty change
}
return 1;
}
DUDE, seriously. I gave you the code for this and the topic got deleted i think?
And now these guys are giving you correctly working code, and your still getting errors. Time to quit copying and pasting and learning how to script/fix errors. |