Private skin problem
#1

Код:
    if(classid == 9)
    {
    GameTextForPlayer(playerid, "~g~[FYB]DoubleMac~n~", 3000, 5);
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    if(strcmp(name, "[FYB]DoubleMac") == 0)
    SetPlayerHealth(playerid,100);
    SetPlayerPos(playerid, 2178.6499,-1660.5642,14.9577);
	SetPlayerCameraPos(playerid, 2182.1299,-1663.9437,14.8180);
	SetPlayerCameraLookAt(playerid, 2178.6499,-1660.5642,14.9577);
	{
	SetPlayerHealth(playerid,0);
    }
    }
	return 1;
}
Okay, my name is [FYB]DoubleMac.
Me and my friend testing private skin selection. So when i try to choose my own skin i die.
All i want is: When another player try to take this ClassID he's die.
Only [FYB] Doublemac can take it.
Reply
#2

Why would you kill them? You could just send a message and return 0; so they don't even spawn. Btw, you have random braces in your code.

Is this even OnPlayerRequestSpawn? It looks like OnPlayerRequestClass, and if they request that class (just switch to it) they will die. You're missing braces for the name check as well. This whole thing is a mess.
Reply
#3

Try something like:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 0) //Change to your Skin ID
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        if(strcmp(name, "[FYB]DoubleMac", false) == 0)
        {
            SendClientMessage(playerid, 0x00FF00AA, "Welcome [FYB]DoubleMac!");
        }
        else {
        GameTextForPlayer(playerid, "~g~[FYB]DoubleMac", 5000, 5);
        SendClientMessage(playerid, 0xFF0000AA, "Only [FYB]DoubleMac can use this skin!");
        return 0;
        }
    }
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 9)
    {
    GameTextForPlayer(playerid, "~g~[FYB]DoubleMac", 5000, 5);
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
Try something like:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 0) //Change to your Skin ID
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        if(strcmp(name, "[FYB]DoubleMac", false) == 0)
        {
            SendClientMessage(playerid, 0x00FF00AA, "Welcome [FYB]DoubleMac!");
        }
        else {
        GameTextForPlayer(playerid, "~g~[FYB]DoubleMac", 5000, 5);
        SendClientMessage(playerid, 0xFF0000AA, "Only [FYB]DoubleMac can use this skin!");
        return 0;
        }
    }
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 9)
    {
    GameTextForPlayer(playerid, "~g~[FYB]DoubleMac", 5000, 5);
    }
    return 1;
}
Worked, thanks.
Reply
#5

No Problem
Reply
#6

Nice .. That is easy, I guess. I could do that, in maybe 1 minute.
Reply
#7

You couldn't script shit Rehan.
Reply
#8

trol, I can script betah than u.
Reply
#9

STOP POSTING ON SOLVED THREADS!
You can't script an automatic gate system, you can't administrate a server for crap, you think you're a hacker but you're not, you're dissing everyone when you're the stupidest one in SAMP who probably couldn't even make a /heal command without having to copy something from the internet, you can't even speak English properly.
Reply
#10

Bro, I have a hole fucking forums, U think, I cant do shit, watch it, Go get ur son of a guns, and have a proper, Hacking match. Just watch u fucking cunt.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)