open.mp forum
[Pawn] Question about skin and team ... - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Question about skin and team ... (/showthread.php?tid=1243)



Question about skin and team ... - DaZzY - 2020-10-13

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 ...


RE: Question about skin and team ... - DaZzY - 2020-10-13

UP :) any one know how please ?


RE: Question about skin and team ... - DaZzY - 2020-10-14

?????


RE: Question about skin and team ... - Worm - 2020-10-14

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);

? ? ? ? ? ? ? ? ? }

? ? ? ? }

}



RE: Question about skin and team ... - DaZzY - 2020-10-14

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


RE: Question about skin and team ... - Worm - 2020-10-15

(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?


RE: Question about skin and team ... - Expert* - 2020-10-15

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


RE: Question about skin and team ... - DaZzY - 2020-10-15

(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 ...


RE: Question about skin and team ... - Expert* - 2020-10-15

(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.. ?


RE: Question about skin and team ... - DaZzY - 2020-10-15

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



No just? the original class selection


RE: Question about skin and team ... - Expert* - 2020-10-15

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


RE: Question about skin and team ... - Expert* - 2020-10-15

Also, u can try to change spawn pos in: AddPlayerClass.

https://www.open.mp/docs/scripting/functions/AddPlayerClass


RE: Question about skin and team ... - DaZzY - 2020-10-16

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