stock IsPoliceskin(skin, playerid)
{
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];
this line make the crash if(IsPoliceskin(skin)) return SendClientMessageEx(playerid, COLOR_LIGHTRED, "[SERVER]: You're not in LSPD so you cannot use that skin");
if(IsInvalidSkin(skin)) {
return ShowPlayerDialog(playerid, G_LOCKER_UNIFORM, DIALOG_STYLE_INPUT, arrGroupData[iGroupID][g_szGroupName],"Invalid skin specified. Choose another.", "Select", "Cancel");
}
PlayerInfo[playerid][pModel] = skin;
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
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 ^^ |
stock IsPoliceskin(skin, playerid)
{
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(playerid, COLOR_LIGHTRED, "[SERVER]: You're not in LSPD so you cannot use that skin");
if(IsInvalidSkin(skin))
{
return ShowPlayerDialog(playerid, G_LOCKER_UNIFORM, DIALOG_STYLE_INPUT, arrGroupData[iGroupID][g_szGroupName],"Invalid skin specified. Choose another.", "Select", "Cancel");
}
PlayerInfo[playerid][pModel] = skin;
SetPlayerSKin(playerid,PlayerInfo[playerid][pModel]);
}
}
stock IsPoliceskin(playerid, skinId)
{
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(playerid, skin))
{
return SendClientMessageEx(playerid, COLOR_LIGHTRED, "[SERVER]: You're not in LSPD so you cannot use that skin");
}
if(IsInvalidSkin(skin))
{
return ShowPlayerDialog(playerid, G_LOCKER_UNIFORM, DIALOG_STYLE_INPUT, arrGroupData[iGroupID][g_szGroupName],"Invalid skin specified. Choose another.", "Select", "Cancel");
}
PlayerInfo[playerid][pModel] = skin;
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
//}?
}