why this not work
#1

I cant get this up, its when a player spawns they need certain name to have the skin

pawn Код:
//==============================================================================
//==============================================================================
    new PlayerName[24];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

    if(GetPlayerSkin(playerid) == 294)
    {
        if(strcmp(PlayerName,"willsuckformoney",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back willsuckformoney");
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is willsuckformoney SKIN ONLY!");
            ForceClassSelection(playerid);
        }
    }

    if(GetPlayerSkin(playerid) == 204)
    {
        if(strcmp(PlayerName,"Babul",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back Babul");
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is Babul SKIN ONLY!");
            ForceClassSelection(playerid);
        }
    }

    if(GetPlayerSkin(playerid) == 123)
    {
        if(strcmp(PlayerName,"grandTheftOtto",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back grandTheftOtto");
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is grandTheftOtto SKIN ONLY!");
            ForceClassSelection(playerid);
        }
    }
//==============================================================================
//==============================================================================
EDIT: This is under onplayerspawn ftw
Reply
#2

use !strcmp as well, and what is the main problem? are they able to spawn?
Reply
#3

yeah they spawn and they send messages, let me check the !strcmp now

EDIT: Tested ! it dont help
Reply
#4

Oh!

Foolish me, I'm guessing the problem is that even if their name isn't that, they still spawn, try SetPlayerHealth(playerid, 0.0); above ForClassSelection(playerid);

(which means you kill them before actually forcing them).
Reply
#5

lol figured that before you posted thanks for helps
Reply
#6

It should be:
pawn Код:
//==============================================================================
//==============================================================================
    new PlayerName[24];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

    if(GetPlayerSkin(playerid) == 294)
    {
        if(!strcmp(PlayerName,"willsuckformoney",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back willsuckformoney");
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is willsuckformoney SKIN ONLY!");
            ForceClassSelection(playerid);
        }
    }

    if(GetPlayerSkin(playerid) == 204)
    {
        if(!strcmp(PlayerName,"Babul",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back Babul");
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is Babul SKIN ONLY!");
            ForceClassSelection(playerid);
        }
    }

    if(GetPlayerSkin(playerid) == 123)
    {
        if(!strcmp(PlayerName,"grandTheftOtto",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back grandTheftOtto");
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is grandTheftOtto SKIN ONLY!");
            ForceClassSelection(playerid);
        }
    }
//==============================================================================
//==============================================================================
But, you did figure it out like that, right?
Reply
#7

Код:
public OnPlayerRequestSpawn(playerid)
{
    new PlayerName[24];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

    if(GetPlayerSkin(playerid) == 294)
    {
        if(!strcmp(PlayerName,"willsuckformoney",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back willsuckformoney");
	    return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is willsuckformoney SKIN ONLY!");
            return 0;
        }
    }

    if(GetPlayerSkin(playerid) == 204)
    {
        if(!strcmp(PlayerName,"Babul",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back Babul");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is Babul SKIN ONLY!");
            return 0;
        }
    }

    if(GetPlayerSkin(playerid) == 123)
    {
        if(!strcmp(PlayerName,"grandTheftOtto",true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back grandTheftOtto");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_CRIMSON, "This is grandTheftOtto SKIN ONLY!");
            return 0;
        }
    }
    return 1;
}
Try putting that code under OnPlayerRequestSpawn

if they can't use the skin, They will not spawn and will go back to Class selection, if they can they will Spawn
return 1 = spawn
return 0 = no spawn
Hope that helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)