• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Question about skin and team ...
#1
Hello i have a Gamemode with many teams ... ( TDM )

And i have a team Justice with 3 skin ( cops , swat , army )

I want army skin have a different spawn position not like cops and swat? ( cops , swat , army are the same teams )

there is some of?my code :

Quote:new const Float:g_SpawnJustice[][4] = {
{-2190.1560, 613.9122,35.1641,116.1742},//
{-2185.8408, 704.4630,53.8906,248.9940},
{-2206.7517, 665.4793,49.4375,175.6908}
};


case 2: { //>>>>>>>>>> THIS case is on OnPlayerSpawn...

? ?
? /
?
? ? ? ? ? ? iRandom = random(sizeof(g_SpawnJustice));
SetPlayerPos(playerid, g_SpawnJustice[iRandom][0], g_SpawnJustice[iRandom][1], g_SpawnJustice[iRandom][2]);
SetPlayerFacingAngle(playerid, g_SpawnJustice[iRandom][3]);

}

I have used?if(GetPlayerSkin(playerid) == 287) army skin and that does'nt work??

Help please :D and i know my english sorry ...
  Reply
#2
UP :) any one know how please ?
  Reply
#3
?????
  Reply
#4
You can create a switch for all teams then under each case, you will set the spawn for each skin.

Example:

Code:
switch(PlayerInfo[playerid][pTeam]) {

? ? ? ? case 1:

? ? ? ? {

? ? ? ? ? ? ? ? ? if(GetPlayerSkin(playerid) == 287)

? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? SetPlayerPos(playerid, -2190.1560, 613.9122,35.1641,116.1742);

? ? ? ? ? ? ? ? ? }

? ? ? ? }

}
  Reply
#5
I have tried to do this but work only when military die respawn at this positon still doesn't work :(
  Reply
#6
(2020-10-14, 12:52 PM)DaZzY Wrote:

I have tried to do this but work only when military die respawn at this positon still doesn't work :(





So according to what you are saying, It works only after the player dies.

Also by "?military ", you mean the team, or do you mean the player?
  Reply
#7
Add delay for 1 - 2 sec after OnPlayerSpawn to RE-Set player pos by skin or use SetPlayerSpawnInfo when player selects team.
  Reply
#8
(2020-10-15, 12:09 PM)Worm Wrote:
(2020-10-14, 12:52 PM)DaZzY Wrote:
I have tried to do this but work only when military die respawn at this positon still doesn't work :(


So according to what you are saying, It works only after the player dies.
Also by "?military ", you mean the team, or do you mean the player?

This is my code :?
Quote:switch (g_Team[g_Player[playerid][playerClass]][teamId]) {
iRandom = random(sizeof(g_SpawnJustice));
SetPlayerPos(playerid, g_SpawnJustice[iRandom][0], g_SpawnJustice[iRandom][1], g_SpawnJustice[iRandom][2]);
SetPlayerFacingAngle(playerid, g_SpawnJustice[iRandom][3]);

if(GetPlayerSkin(playerid) == 287)
? {
? SetPlayerPos(playerid, -1303.9714,492.5781,11.1953);
? }
?
i have many "case" i show this "case" of this team i have add?if(GetPlayerSkin(playerid) == 287) (military skin ) and position special to military?
When i choose player with military skin and i click on "SPAWN" on request class the military player skin spawn same position with other player of skin cops and swat But when player die with skin 287 the player spawn at position of military skin

Quote:Add delay for 1 - 2 sec after OnPlayerSpawn to RE-Set player pos by skin or use SetPlayerSpawnInfo when player selects team.
?
This maybe a good idea the timer but SetPlayerSpawnInfo doesn't work also :(

So the problem i have a same team (justice) but i want a differents position for skin ...
  Reply
#9
(2020-10-15, 01:10 PM)DaZzY Wrote:
(2020-10-15, 12:09 PM)Worm Wrote:
(2020-10-14, 12:52 PM)DaZzY Wrote:

I have tried to do this but work only when military die respawn at this positon still doesn't work :(





So according to what you are saying, It works only after the player dies.

Also by "?military ", you mean the team, or do you mean the player?



This is my code :?

Quote:switch (g_Team[g_Player[playerid][playerClass]][teamId]) {

iRandom = random(sizeof(g_SpawnJustice));

SetPlayerPos(playerid, g_SpawnJustice[iRandom][0], g_SpawnJustice[iRandom][1], g_SpawnJustice[iRandom][2]);

SetPlayerFacingAngle(playerid, g_SpawnJustice[iRandom][3]);



if(GetPlayerSkin(playerid) == 287)

? {

? SetPlayerPos(playerid, -1303.9714,492.5781,11.1953);

? }
?

i have many "case" i show this "case" of this team i have add?if(GetPlayerSkin(playerid) == 287) (military skin ) and position special to military?

When i choose player with military skin and i click on "SPAWN" on request class the military player? skin spawn same position with other player of skin cops and swat But when player die with skin 287 the player spawn at position of military skin



Quote:Add delay for 1 - 2 sec after OnPlayerSpawn to RE-Set player pos by skin or use SetPlayerSpawnInfo when player selects team.
?

This maybe a good idea the timer but SetPlayerSpawnInfo doesn't work also :(



So the problem i have a same team (justice) but i want a differents position for skin ...





What do u use to select teams ? Dialog or.. ?
  Reply
#10
Quote:What do u use to select teams ? Dialog or.. ?



No just? the original class selection
  Reply
#11
PHP Code:
public OnPlayerRequestSpawn(playerid)
{
if( 
IsPlayerNPCplayerid ) ) return 1;


if( 
GetPlayerSkinplayerid ) == 287 )
{
? ? 
SetSpawnInfoplayerid00g_SpawnJustice][ ], g_SpawnJustice][ ], g_SpawnJustice][ ], g_SpawnJustice][ ], 2636281500);
}
else if( 
GetPlayerSkinplayerid ) == 287 )
{
? ? 
SetSpawnInfoplayerid00g_SpawnJustice][ ], g_SpawnJustice][ ], g_SpawnJustice][ ], g_SpawnJustice][ ], 2636281500);
}
else if( 
GetPlayerSkinplayerid ) == 287 )
{
? ? 
SetSpawnInfoplayerid00g_SpawnJustice][ ], g_SpawnJustice][ ], g_SpawnJustice][ ], g_SpawnJustice][ ], 2636281500);
}
return 
1;


Idk if u can use this if you use class selection.
You probably only get that skin when u use class selection and spawn in to the world at least once
  Reply
#12
Also, u can try to change spawn pos in: AddPlayerClass.

https://www.open.mp/docs/scripting/funct...layerClass
  Reply
#13
Not working again xD the player spawn another position ( position when player bug ) but i get another idea to make military skin spawn at position

and the idea is to make a invisible checkpoint when skin 287 enter this CP he get teleported to militaryspawn so i put this CP on COPS and SWAT spawn xD
  Reply


Forum Jump: