new PlayerInfo[MAX_PLAYERS][pInfo];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Player Color & Skin Saving Loaded");
print("--------------------------------------\n");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(!dini_Exists(UserPath(playerid))) dini_Create(UserPath(playerid));
dini_IntSet(UserPath(playerid), "SkinID", PlayerInfo[playerid][pModel]);
dini_IntSet(UserPath(playerid), "ColorID", PlayerInfo[playerid][pColorID]);
return 1;
}
public OnPlayerConnect(playerid)
{
if(!dini_Exists(UserPath(playerid)))
{
PlayerInfo[playerid][pModel] = -1;
PlayerInfo[playerid][pColorID] = random(MAX_COLOR);
}
else
{
PlayerInfo[playerid][pModel] = dini_Int(UserPath(playerid), "SkinID");
PlayerInfo[playerid][pColorID] = dini_Int(UserPath(playerid), "ColorID");
}
switch(PlayerInfo[playerid][pModel])
{
case 0:SetPlayerColor(playerid, WHITE);
case 1:SetPlayerColor(playerid, GREEN);
case 2:SetPlayerColor(playerid, RED);
case 3:SetPlayerColor(playerid, YELLOW);
case 4:SetPlayerColor(playerid, BLUE);
case 5:SetPlayerColor(playerid, PURPLE);
case 6:SetPlayerColor(playerid, GOLD);
case 7:SetPlayerColor(playerid, PINK);
case 8:SetPlayerColor(playerid, ORANGE);
case 9:SetPlayerColor(playerid, BLACK);
case 10:SetPlayerColor(playerid, GREY);
case 11:SetPlayerColor(playerid, BROWN);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pModel] >= 0 || PlayerInfo[playerid][pModel] < 300) SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
return 1;
}
CMD:color(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_COLOR, DIALOG_STYLE_LIST, "Player Color", "White\nGreen\nRed\nYellow\nBlue\nPurple\nGold\nPink\nOrange\nBlack\nGrey\nBrown", "Choose", "Close");
return 1;
}
CMD:skin(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT, "Skin selection", "Type in a skin you would like to have.", "Choose", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_COLOR && response)
{
switch(listitem)
{
case 0:
{
GameTextForPlayer(playerid,"~y~Color set to White",2000,3);
SetPlayerColor(playerid, WHITE);
}
case 1:
{
GameTextForPlayer(playerid,"~y~Color set to Green",2000,3);
SetPlayerColor(playerid, GREEN);
}
case 2:
{
GameTextForPlayer(playerid,"~y~Color set to Red",2000,3);
SetPlayerColor(playerid, RED);
}
case 3:
{
GameTextForPlayer(playerid,"~y~Color set to Yellow",2000,3);
SetPlayerColor(playerid, YELLOW);
}
case 4:
{
GameTextForPlayer(playerid,"~y~Color set to Blue",2000,3);
SetPlayerColor(playerid, BLUE);
}
case 5:
{
GameTextForPlayer(playerid,"~y~Color set to Purple",2000,3);
SetPlayerColor(playerid, PURPLE);
}
case 6:
{
GameTextForPlayer(playerid,"~y~Color set to Gold",2000,3);
SetPlayerColor(playerid, GOLD);
}
case 7:
{
GameTextForPlayer(playerid,"~y~Color set to Pink",2000,3);
SetPlayerColor(playerid, PINK);
}
case 8:
{
GameTextForPlayer(playerid,"~y~Color set to Orange",2000,3);
SetPlayerColor(playerid, ORANGE);
}
case 9:
{
GameTextForPlayer(playerid,"~y~Color set to Black",2000,3);
SetPlayerColor(playerid, BLACK);
}
case 10:
{
GameTextForPlayer(playerid,"~y~Color set to Grey",2000,3);
SetPlayerColor(playerid, GREY);
}
case 11:
{
GameTextForPlayer(playerid,"~y~Color set to Brown",2000,3);
SetPlayerColor(playerid, BROWN);
}
}
PlayerInfo[playerid][pModel] = listitem;
return 1;
}
if(dialogid == DIALOG_SKIN && response)
{
if(strval(inputtext) < 0 || strval(inputtext) > 299) SendClientMessage(playerid, WHITE, "SERVER: Cannot go under 0 or above 299.");
new skin = strval(inputtext);
PlayerInfo[playerid][pModel] = skin;
SetPlayerSkin(playerid, skin);
GameTextForPlayer(playerid,"~g~Skin ~g~Changed",2000,3);
return 1;
}
return 0;
}
public OnPlayerSpawn(playerid) { if(PlayerInfo[playerid][pModel] >= 0 || PlayerInfo[playerid][pModel] < 300) return true; return 1; }
Replace your code with
Код:
public OnPlayerSpawn(playerid) { if(PlayerInfo[playerid][pModel] >= 0 || PlayerInfo[playerid][pModel] < 300) ; return 1; } |
error 036: empty statement
if(PlayerInfo[playerid][pModel] >= 0 || PlayerInfo[playerid][pModel] < 300) ;
Oops, I'm sorry try this:
Код:
if(PlayerInfo[playerid][pModel] >= 0 || PlayerInfo[playerid][pModel] < 300) return 0; |
if(PlayerInfo[playerid][pModel] >= 0 || PlayerInfo[playerid][pModel] < 300) ;
error 036: empty statement
if(PlayerInfo[playerid][pModel] >= 0 || PlayerInfo[playerid][pModel] < 300) ;
public OnPlayerSpawn(playerid) { return 1; }
Delete this string :
Код:
if(PlayerInfo[playerid][pModel] >= 0 || PlayerInfo[playerid][pModel] < 300) ; Код:
public OnPlayerSpawn(playerid) { return 1; } |
public OnPlayerSpawn(playerid) { pInEvent[playerid] = 0; new Random = random(sizeof(RandomSpawns)); SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); return 1; }
public OnPlayerSpawn(playerid) { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); return 1; }