Tag Lock
#1

Hey Guys, Just a question
When Someone Join's The Server With Just say.. [GSV]Whatever
He Can Choose a Certain Skin Applied?
And if he doesnt have that Tag He Wont be able to spawn with that skin

If You Could please help me with this that would be
more appreciable.
Reply
#2

pawn Код:
new Pname[24];
GetPlayerName(playerid, Pname, 24);
if(!strcmp(Pname, "[GSV]", true, 5))
{
//Player has the [GSV] tag.
}
else
{
//Player cant chose it!
}
Reply
#3

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
new Pname[24];
GetPlayerName(playerid, Pname, 24);
if(!strcmp(Pname, "[GSV]", true, 5))
{
//Player has the [GSV] tag.
}
else
{
//Player cant chose it!
}

Thanks :P Where Would i put That?? Lol

And This is My OnPlayerSpawn Code if that helps...

pawn Код:
public OnPlayerSpawn(playerid)
{
    HideAllTextDraws(playerid);
    Spawned[playerid] = 1;

    if(gTeam[playerid] == TEAM_ADMIN && ( !IsPlayerAdmin(playerid) && !IsPlayerLAdmin(playerid) ) ) {
    ForceClassSelection(playerid);
    return SetPlayerHealth(playerid, 0.0);
    }

    if(InJail[playerid] == 1) {
    SendClientMessage(playerid,red,"You cannot escape your punishment");
  SetPlayerPos(playerid,264.21, 77.57, 1001.03);
    SetPlayerInterior(playerid,6);
    return SetTimerEx("JailRelease",JAIL_TIME,0,"i",playerid);
    }

  GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~g~let the war begin! Good Luck",4000,5);
  PlayerPlaySound(playerid, 1098, 0.0, 0.0, 0.0);
  SetPlayerInterior(playerid,0);

    TeamFix();

    if(gTeam[playerid] == TEAM_GROVE) { SetPlayerColor(playerid,COLOR_GREEN); SetPlayerInterior(playerid,3); }
    else if(gTeam[playerid] == TEAM_BALLAS) SetPlayerColor(playerid,COLOR_PURPLE);
    else if(gTeam[playerid] == TEAM_AZTEC) SetPlayerColor(playerid,COLOR_LIGHTBLUE);
    else if(gTeam[playerid] == TEAM_NANG) SetPlayerColor(playerid,COLOR_DARKRED);
    else if(gTeam[playerid] == TEAM_VAGOS) SetPlayerColor(playerid,COLOR_YELLOW);
    else if(gTeam[playerid] == TEAM_COPS) SetPlayerColor(playerid,COLOR_BLUE);
    else if(gTeam[playerid] == TEAM_MAFIA) SetPlayerColor(playerid,COLOR_BLACK);
    else if(gTeam[playerid] == TEAM_BIKER) SetPlayerColor(playerid,COLOR_ORANGE);
    else if(gTeam[playerid] == TEAM_TRIAD) SetPlayerColor(playerid,COLOR_WHITE);
    else if(gTeam[playerid] == TEAM_ADMIN) { SetPlayerColor(playerid,COLOR_GOLD); GivePlayerWeapon(playerid,34,200); GivePlayerWeapon(playerid,16,50); }
    else if(gTeam[playerid] == TEAM_USMC) { SetPlayerColor(playerid,COLOR_DARKBROWN); SetPlayerFacingAngle(playerid,90);    GivePlayerWeapon(playerid,16,7); }
    else if(gTeam[playerid] == TEAM_LOWRIDER) SetPlayerColor(playerid,red);
    else if(gTeam[playerid] == TEAM_SKATER) SetPlayerColor(playerid,Skater_grey);
    else if(gTeam[playerid] == TEAM_UNDERTAKER) SetPlayerColor(playerid,COLOR_PINK);
    else if(gTeam[playerid] == TEAM_WORKER) SetPlayerColor(playerid,Worker_green);

    //============ [ Biz ]===============//
    //if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
    //  new playerbiz = PlayerInfo[playerid][bowned];
    //  SetPlayerPos(playerid,BizInfo[playerbiz][xpos],BizInfo[playerbiz][ypos],BizInfo[playerbiz][zpos] );
    //  SetPlayerInterior(playerid, BizInfo[playerbiz][bizint] );
    //  SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
 //     }

    return 1;
}
Reply
#4

**BUMP**
Reply
#5

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
new Pname[24];
GetPlayerName(playerid, Pname, 24);
if(!strcmp(Pname, "[GSV]", true, 5))
{
//Player has the [GSV] tag.
}
else
{
//Player cant chose it!
}
Strfind would it not be.
Reply
#6

Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
new Pname[24];
GetPlayerName(playerid, Pname, 24);
if(!strcmp(Pname, "[GSV]", true, 5))
{
//Player has the [GSV] tag.
}
else
{
//Player cant chose it!
}
Strfind would it not be.
uhhh? lol it still doesnt work :P
Reply
#7

Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
new Pname[24];
GetPlayerName(playerid, Pname, 24);
if(!strcmp(Pname, "[GSV]", true, 5))
{
//Player has the [GSV] tag.
}
else
{
//Player cant chose it!
}
Strfind would it not be.
Not exactly. I used strcmp for the first 5 characters in the name so it compares that. Strfind would search the whole playername for the [GSV], most clans only use it at the front.
Reply
#8

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
new Pname[24];
GetPlayerName(playerid, Pname, 24);
if(!strcmp(Pname, "[GSV]", true, 5))
{
//Player has the [GSV] tag.
}
else
{
//Player cant chose it!
}
Strfind would it not be.
Not exactly. I used strcmp for the first 5 characters in the name so it compares that. Strfind would search the whole playername for the [GSV], most clans only use it at the front.
Ah didn't read the whole line just looked at the strcmp bit, my bad
Reply
#9

Sorry To Do This, But BUMP!
I'm in Dire Desperation To Add This

This is My OnPlayerSpawn Code

pawn Код:
public OnPlayerSpawn(playerid)
{
    HideAllTextDraws(playerid);
    Spawned[playerid] = 1;

    if(gTeam[playerid] == TEAM_ADMIN && ( !IsPlayerAdmin(playerid) && !IsPlayerLAdmin(playerid) ) ) {
    ForceClassSelection(playerid);
    return SetPlayerHealth(playerid, 0.0);
    }

    if(InJail[playerid] == 1) {
    SendClientMessage(playerid,red,"You cannot escape your punishment");
  SetPlayerPos(playerid,264.21, 77.57, 1001.03);
    SetPlayerInterior(playerid,6);
    return SetTimerEx("JailRelease",JAIL_TIME,0,"i",playerid);
    }

  GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~g~let the war begin! Good Luck",4000,5);
  PlayerPlaySound(playerid, 1098, 0.0, 0.0, 0.0);
  SetPlayerInterior(playerid,0);

    TeamFix();

    if(gTeam[playerid] == TEAM_GROVE) { SetPlayerColor(playerid,COLOR_GREEN); SetPlayerInterior(playerid,3); }
    else if(gTeam[playerid] == TEAM_BALLAS) SetPlayerColor(playerid,COLOR_PURPLE);
    else if(gTeam[playerid] == TEAM_AZTEC) SetPlayerColor(playerid,COLOR_LIGHTBLUE);
    else if(gTeam[playerid] == TEAM_NANG) SetPlayerColor(playerid,COLOR_DARKRED);
    else if(gTeam[playerid] == TEAM_VAGOS) SetPlayerColor(playerid,COLOR_YELLOW);
    else if(gTeam[playerid] == TEAM_COPS) SetPlayerColor(playerid,COLOR_BLUE);
    else if(gTeam[playerid] == TEAM_MAFIA) SetPlayerColor(playerid,COLOR_BLACK);
    else if(gTeam[playerid] == TEAM_BIKER) SetPlayerColor(playerid,COLOR_ORANGE);
    else if(gTeam[playerid] == TEAM_TRIAD) SetPlayerColor(playerid,COLOR_WHITE);
    else if(gTeam[playerid] == TEAM_ADMIN) { SetPlayerColor(playerid,COLOR_GOLD); GivePlayerWeapon(playerid,34,200); GivePlayerWeapon(playerid,16,50); }
    else if(gTeam[playerid] == TEAM_MERCENARYS) {   SetPlayerColor(playerid,COLOR_DARKBROWN); SetPlayerFacingAngle(playerid,90);    GivePlayerWeapon(playerid,16,7); }
    else if(gTeam[playerid] == TEAM_LOWRIDER) SetPlayerColor(playerid,red);
    else if(gTeam[playerid] == TEAM_SKATER) SetPlayerColor(playerid,Skater_grey);
    else if(gTeam[playerid] == TEAM_UNDERTAKER) SetPlayerColor(playerid,COLOR_PINK);
    else if(gTeam[playerid] == TEAM_WORKER) SetPlayerColor(playerid,Worker_green);
    ResetZones();
    SetTimerEx("Godoff", 10000, 0, "d", playerid);
    SetPlayerHealth(playerid, 99999);
    SendClientMessage(playerid,0x80400096,"You Have Spawn Protection on! You Are Protected From Spawn killing For 10 Seconds.");

    //============ [ Biz ]===============//
    //if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
    //  new playerbiz = PlayerInfo[playerid][bowned];
    //  SetPlayerPos(playerid,BizInfo[playerbiz][xpos],BizInfo[playerbiz][ypos],BizInfo[playerbiz][zpos] );
    //  SetPlayerInterior(playerid, BizInfo[playerbiz][bizint] );
    //  SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
 //     }

    return 1;
}
Would it be placed like in the section
of
pawn Код:
if(gTeam[playerid] == TEAM_ADMIN && ( !IsPlayerAdmin(playerid) && !IsPlayerLAdmin(playerid) ) ) {
    ForceClassSelection(playerid);
    return SetPlayerHealth(playerid, 0.0);
    }
?

Thanks For Any Help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)