Help with SrciptinG!
#1

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(playeridclassid)
{
    switch(
classid)
    {
    case 
0Locked[playerid] = 0//this one DOESNT.
    
case 1Locked[playerid] = 0//this one too
    
case 2Locked[playerid] = 1//this is going to be locked, right?
    
}
    return 
1;
}
public 
OnPlayerRequestSpawn(playerid)
{
    if(
Locked[playerid]) return 0;
    {
    
SendClientMessage(playeridCOLOR_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(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/unlock yolo"))
    {
        
Locked[playerid] = 0;
        
SendClientMessage(playeridCOLOR_GREEN"Skins unlocked!\nHurry you got the VIP skin");
        new 
pname[MAX_PLAYER_NAME], string[22 MAX_PLAYER_NAME];
        
GetPlayerName(playeridpnamesizeof(pname)); //It will work more accuratly
        
format(stringsizeof(string), "%s has just unlocked the vip skin!"pname);//%s = string :D, %i = integer, %d = decimal
        
SendClientMessageToAll(0xAAAAAAAAstring);
    }
    return 
1;

Reply
#2

PHP код:
#define MAX_SKINS (312) // ot 0 to 311
static bool:p_avalibleskins[MAX_PLAYERS][MAX_SKINS];
/*
 * native SetPlayerSkinLock(playerid, skin, bool:togle=false);
 * native IsPlayerSkinLocked(playerid, skin);
 */
#define SetPlayerSkinLock(%1,%2,%3) p_avalibleskins[%1][%2] = %3
#define IsPlayerSkinLocked(%1,%2) (!p_avalibleskins[%1][%2])
public OnPlayerRequestClass(playeridclassid)
{
    if (
IsPlayerSkinLocked(playeridclassid)) {
         
// SetPlayerSkin(playerid, classid + 1); // debug
         
SendClientMessage(playeridCOLOR_ORANGE"This skin is locked for VIP");
    }
    return 
1;
}
public 
OnPlayerRequestSpawn(playerid)
{
    if(
IsPlayerSkinLocked(playeridGetPlayerSkin(playerid)))
    {
    
SendClientMessage(playeridCOLOR_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(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/unlock yolo"))
    {
        
SetPlayerSkinLock(playeridGetPlayerSkin(playerid), true); // Set unlock current skin
        
SendClientMessage(playeridCOLOR_GREEN"Skins unlocked!\nHurry you got the VIP skin");
        new 
pname[MAX_PLAYER_NAME], string[22 MAX_PLAYER_NAME];
        
GetPlayerName(playeridpnamesizeof(pname)); //It will work more accuratly
        
format(stringsizeof(string), "%s has just unlocked the vip skin!"pname);//%s = string :D, %i = integer, %d = decimal
        
SendClientMessageToAll(0xAAAAAAAAstring);
    }
    return 
1;

Reply
#3

In the
PHP код:
public OnPlayerRequestSpawn(playerid)
{
    if(
Locked[playerid]) return 0;
    {
    
SendClientMessage(playeridCOLOR_ORANGE"DEAR USER,\nThis skin is password protected,If you have the password than you can just unlock by /unlock [PASSWORD HERE]");
    }
    return 
1;

How do u return 0 and then open a bracket..
Change it to:
[php
public OnPlayerRequestSpawn(playerid)
{
if(Locked[playerid])
{
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 0;
}
return 1;
}
[/php]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)