Dialog crash help
#1

My server crash when i try to change skin what might be the problem here, is something with the ispoliceskin.

PHP код:
stock IsPoliceskin(skinplayerid)
{
    if(
IsACop(playerid))
    if(!(
280 <= skin <= 288)) return 1;
    return 
0;

PHP код:
case G_LOCKER_UNIFORM: if(response)    {
            new 
skin strval(inputtext), iGroupID PlayerInfo[playerid][pMember];
    
this line make the crash        if(IsPoliceskin(skin)) return SendClientMessageEx(playeridCOLOR_LIGHTRED"[SERVER]: You're not in LSPD so you cannot use that skin"); 
            if(
IsInvalidSkin(skin)) {
                return 
ShowPlayerDialog(playeridG_LOCKER_UNIFORMDIALOG_STYLE_INPUTarrGroupData[iGroupID][g_szGroupName],"Invalid skin specified. Choose another.""Select""Cancel");
            }
            
PlayerInfo[playerid][pModel] = skin;
            
SetPlayerSkin(playeridPlayerInfo[playerid][pModel]); 
Reply
#2

if(IsPoliceskin(skin,playerid))
Reply
#3

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
if(IsPoliceskin(skin,playerid))
That wont change anything.
Reply
#4

Maybe the problem is in SendClientMessageEx function?
Reply
#5

Well its a miracle that u were able to compile anyways since u just ignored one of the parameters
And also u should think bout your coding style, use brackets ...
Its not just the missing brackets tho ^^
Reply
#6

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
Well its a miracle that u were able to compile anyways since u just ignored one of the parameters
And also u should think bout your coding style, use brackets ...
Its not just the missing brackets tho ^^
Still i don't understand whats the problem
Reply
#7

Try this:
PHP код:
stock IsPoliceskin(skinplayerid)
{
    if(
IsACop(playerid))
    {
        if(!(
280 <= skin <= 288)) return 1;
    }
    return 
0;
}
case 
G_LOCKER_UNIFORM:
{
    if(
response)
    {
        new 
skin strval(inputtext),iGroupID PlayerInfo[playerid][pMember];
        if(
IsPoliceskin(skin,playerid))return SendClientMessageEx(playeridCOLOR_LIGHTRED"[SERVER]: You're not in LSPD so you cannot use that skin");
        if(
IsInvalidSkin(skin))
        {
            return 
ShowPlayerDialog(playeridG_LOCKER_UNIFORMDIALOG_STYLE_INPUTarrGroupData[iGroupID][g_szGroupName],"Invalid skin specified. Choose another.""Select""Cancel");
        }
        
PlayerInfo[playerid][pModel] = skin;
        
SetPlayerSKin(playerid,PlayerInfo[playerid][pModel]);
    }

Reply
#8

PHP код:
stock IsPoliceskin(playeridskinId)
{
    if(
IsACop(playerid))
    {
        if(!( (
280 <= skinId) & (skinId <= 288) )) 
        {
            return 
1;
        }
    }
    return 
0;
}  
case 
G_LOCKER_UNIFORM: if(response)    {
    new 
skin strval(inputtext);
    new 
iGroupID PlayerInfo[playerid][pMember];
    
//Like someone mentioned already it may be SendClientMessageEx
    
if(IsPoliceskin(playeridskin))
    {
        return 
SendClientMessageEx(playeridCOLOR_LIGHTRED"[SERVER]: You're not in LSPD so you cannot use that skin"); 
    }            
    if(
IsInvalidSkin(skin)) 
    {
        return 
ShowPlayerDialog(playeridG_LOCKER_UNIFORMDIALOG_STYLE_INPUTarrGroupData[iGroupID][g_szGroupName],"Invalid skin specified. Choose another.""Select""Cancel");
    }
    
PlayerInfo[playerid][pModel] = skin;
    
SetPlayerSkin(playeridPlayerInfo[playerid][pModel]);  
//}?

If u write your code like that you can overlook it easier
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)