Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: sseebbyy on June 24, 2011, 11:48:25 pm

Title: How ? Please. 2 player, Just 1 have accept to skin [PAWN]
Post by: sseebbyy on June 24, 2011, 11:48:25 pm
I do not know how to explain it too well ...

[PAWN]

I like when there are more players on the server, only one can make a skin, and others to have skin that hang

How?

For Example: there are 3 players on the server, and I have chosen me to be a cop, the other two can not select all the police.
Title: Re: How ? Please. 2 player, Just 1 have accept to skin [PAWN]
Post by: [AoD]NC on June 25, 2011, 12:41:33 am
I think it should be this way:

Code: [Select]
function onPlayerSpawn {
get current skin (possible? i think it is)
while (loop for all players) {
if selected players skin == spawned players skin {
kill.spawnedplayer()
}
}
}

Hope that helps :).
Title: Re: How ? Please. 2 player, Just 1 have accept to skin [PAWN]
Post by: sseebbyy on June 25, 2011, 10:46:34 am
of course, thank you !  ;D ;D ;D

I think is possible !

Thank You Very Much !  ;D ;D
Title: Re: How ? Please. 2 player, Just 1 have accept to skin [PAWN]
Post by: [AoD]NC on June 25, 2011, 01:12:23 pm
I don't know if PAWN has onPlayerRequestSkin(), but then you could use the announce function to display "skin not available".

And one small note. In the while loop for all players, exclude the spawned player
Code: [Select]
while (loop for all players) {
if ( selected players skin == spawned players skin ) && ( spawned player ID != selected player ID) {
kill.spawnedplayer()
}
}
Title: Re: How ? Please. 2 player, Just 1 have accept to skin [PAWN]
Post by: sseebbyy on June 25, 2011, 10:12:18 pm
I have any idea

look :

[pawn]new IsPRChosen;

public OnPlayerDeath(playerid, killerid, reason)
{
    if(PR[playerid] == 1) {
      SendClientMessage(playerid,COLOR_YELLOW,"test");
      if(IsPRChosen == 1) {
      IsPRChosen = 0;
      }
        }
    return 1;
}

public OnPlayerSpawn(playerid,classid,teamid)
{
    ToggleWidescreenForPlayer(playerid,0);
    if(PR[playerid] == 1) {
       if(IsPRChosen == 0) {
      PR[playerid] = 1;
      IsPRChosen = 1;
           }
       if(IsPRChosen == 1) {
           GameTextForPlayer(playerid,"~o~Is Busy This Skin !");
           SetPlayerHealth(playerid,0);
           }
           }
   return 1;
}

public OnPlayerRequestClass(playerid, classid, skinid)
{
if(classid == 0) {
       if(IsPRChosen == 0) {
       PR[playerid] = 1;
       SetPlayerSkin(playerid,0);
       GameTextForPlayerBottom(playerid,"~y~President");
         }
       if(IsPRChosen == 1) {
         GameTextForPlayerBottom(playerid,"~o~Busy");
         }
       }
   return 1;
}[/pawn]


But, at spawn , killed me imediatly...

Why?

I solved problem with one timer on onplayerspawn  ;D

TOPIC CLOSED


not work
Title: Re: How ? Please. 2 player, Just 1 have accept to skin [PAWN]
Post by: sseebbyy on June 27, 2011, 01:49:55 pm
I solved the problem... needed to add if(IsPRChosen == 1) { first, not if(IspPRChosen == 0) { first.

----Topic Closed------