29.08.2015, 18:34
I want to make it like when someone try to spawn with locked skin,i want it to display a message like "SKIN LOCKED"
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 0: Locked[playerid] = 0; //this one DOESNT.
case 1: Locked[playerid] = 0; //this one too
case 2: Locked[playerid] = 1; //this is going to be locked, right?
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(Locked[playerid]) return 0;
{
SendClientMessage(playerid, COLOR_ORANGE, "DEAR USER,\nThis skin is password protected,If you have the password than you can just unlock by /unlock [PASSWORD HERE]");
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/unlock yolo"))
{
Locked[playerid] = 0;
SendClientMessage(playerid, COLOR_GREEN, "Skins unlocked!\nHurry you got the VIP skin");
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname)); //It will work more accuratly
format(string, sizeof(string), "%s has just unlocked the vip skin!", pname);//%s = string :D, %i = integer, %d = decimal
SendClientMessageToAll(0xAAAAAAAA, string);
}
return 1;
}