FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups   RegisterRegister   ProfileProfile  Log in to check your private messagesP.M.  Log inLog in


 Bienvenue Guest 
Bienvenue sur le site de la team KgS             

Adresse du serveur SA-MP:             

                  

dernière version SA:MP 0.3.7 Télécharger             
dm

 
Post new topic   Reply to topic    Team KgS Forum Index -> SA-MP -> Scripting SA-MP [Pawn]
Previous topic :: Next topic  

Author Message
Mr_C30
VIP
VIP

Offline

Joined: 11 Sep 2008
Posts: 1,073
Localisation: 07
Masculin Vierge (24aoû-22sep)
Point(s): 8,388,607
Moyenne de points: 7,817.90

PostPosted: Mon 9 Feb - 11:25 (2009)    Post subject: dm Reply with quote

donc voila mon probleme quand on meurt en dm on repawn a sont spawn-team et le serveur crach lors que tout et fait pour respaner dans le dm par spawn aléatoir !!

voicci les script !!



dans mon onplayerspawn
CODE wrote:

if(dm1[playerid] == 1)
{
new rand = random(sizeof(PlayerSpawns));
SetPlayerPos(playerid, PlayerSpawns[rand][0], PlayerSpawns[rand][1], PlayerSpawns[rand][2]);
SetPlayerSkin(playerid,220);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 38,800000);
GivePlayerWeapon(playerid, 4,1);
}
if(dm1[playerid] ==0) {//si la variable = 0
}
if(dm2[playerid] == 1)
{
new rand = random(sizeof(PlayerSpawnsdm2));
SetPlayerPos(playerid, PlayerSpawnsdm2[rand][0], PlayerSpawnsdm2[rand][1], PlayerSpawnsdm2[rand][2]);
SetPlayerSkin(playerid,29);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 8,1);
GivePlayerWeapon(playerid, 17,600);
}
if(dm2[playerid] ==0) {//si la variable = 0
}


mon respawn aléatoir:
CODE wrote:

new Float:PlayerSpawns[9][3] ={
{-2062.5583,237.4662,36.2890},
{-2047.2618,307.4254,40.7450},
{-2120.5583,242.4662,36.2890},
{-2129.9285,282.1908,35.3134},
{-2130.4556,150.3958,41.3806},
{-2097.2253,134.0325,35.5661},
{-2048.1135,180.1529,34.5752},
{-2063.3606,257.0724,35.3324},
{-2082.5596,304.6336,35.4802}
};
new Float:PlayerSpawnsdm2[5][3] ={
{387.9977,-2024.7217,8.8101},
{398.8067,-2058.6528,7.8359},
{358.7761,-2072.3003,10.6953},
{353.2311,-2032.0028,7.8359},
{375.9718,-2059.3662,10.6953}
};


mes new
CODE wrote:

new dm1[MAX_PLAYERS];
new dm2[MAX_PLAYERS];



cmd

CODE wrote:

//-----------------------------------------------dm1----------------------------
if(strcmp(cmdtext,"/dm1",true) == 0)
{
{
{
dm1[playerid] = 1;
new rand = random(sizeof(PlayerSpawns));
SetPlayerPos(playerid, PlayerSpawns[rand][0], PlayerSpawns[rand][1], PlayerSpawns[rand][2]);
SetPlayerSkin(playerid,220);
ResetPlayerWeapons(giveplayerid);
GivePlayerWeapon(playerid, 9,1);
SetPlayerWorldBounds(playerid, -2020.002, -2139.745, 333.6941, 140.3909);
}
}
return 1;
}
//-----------------------------------------------dm2----------------------------
if(strcmp(cmdtext,"/dm2",true) == 0)
{
{
{
dm1[playerid] = 1;
new rand = random(sizeof(PlayerSpawnsdm2));
SetPlayerPos(playerid, PlayerSpawnsdm2[rand][0], PlayerSpawnsdm2[rand][1], PlayerSpawnsdm2[rand][2]);

SetPlayerSkin(playerid,29);
ResetPlayerWeapons(giveplayerid);
GivePlayerWeapon(playerid, 8,1);
SetPlayerWorldBounds(playerid, 489.7193, 349.0144, -1989.786, -2135.852);
}
}
return 1;
}



donc voila Crying or Very sad j'aai fait tout les code moi méme donc jai petétre fait un merde quelque part ais la je voitpas du tout Suicide


a++


Back to top
Skype
Author Message
Publicité






PostPosted: Mon 9 Feb - 11:25 (2009)    Post subject: Publicité

PublicitéSupprimer les publicités ?
Back to top
Author Message
[KgS]Sylvain
Admin Forum
Admin Forum

Offline

Joined: 13 Jun 2008
Posts: 2,011
Localisation: France Puy De Dôme (63)
Masculin Capricorne (22déc-19jan)
Point(s): 8,388,607
Moyenne de points: 4,171.36

PostPosted: Mon 9 Feb - 16:25 (2009)    Post subject: dm Reply with quote

Déjà
Code:
 if(dm1[playerid] ==0) {//si la variable = 0
}
et
Code:
 if(dm2[playerid] ==0) {//si la variable = 0
}
ne serve à rien.

Et remplace tes commande de DM par
Code:
//-----------------------------------------------dm1----------------------------
   if(strcmp(cmdtext,"/dm1",true) == 0)
   {
      dm1[playerid] = 1;
      new rand = random(sizeof(PlayerSpawns));
      SetPlayerPos(playerid, PlayerSpawns[rand][0], PlayerSpawns[rand][1], PlayerSpawns[rand][2]);
      SetPlayerSkin(playerid,220);
      ResetPlayerWeapons(playerid);
      GivePlayerWeapon(playerid, 9,1);
      SetPlayerWorldBounds(playerid, -2020.002, -2139.745, 333.6941, 140.3909);
      return 1;
   }
//-----------------------------------------------dm2----------------------------
   if(strcmp(cmdtext,"/dm2",true) == 0)
   {
      dm1[playerid] = 1;
      new rand = random(sizeof(PlayerSpawnsdm2));
      SetPlayerPos(playerid, PlayerSpawnsdm2[rand][0], PlayerSpawnsdm2[rand][1],     PlayerSpawnsdm2[rand][2]);
      SetPlayerSkin(playerid,29);
      ResetPlayerWeapons(playerid);
      GivePlayerWeapon(playerid, 8,1);
      SetPlayerWorldBounds(playerid, 489.7193, 349.0144, -1989.786, -2135.852);
      return 1;
   }

----------------------------------


Back to top
Visit poster’s website MSN Skype
Author Message
Mr_C30
VIP
VIP

Offline

Joined: 11 Sep 2008
Posts: 1,073
Localisation: 07
Masculin Vierge (24aoû-22sep)
Point(s): 8,388,607
Moyenne de points: 7,817.90

PostPosted: Mon 9 Feb - 18:02 (2009)    Post subject: dm Reply with quote

je vais esayer sa de suite Smile

Modifier:

sa crasch toujour le joueure revien a sont spwn team et il saute pour revenir dans la zone dm (comme le spawn team et loint du dm ) et la il crach !! Sad


Back to top
Skype
Display posts from previous:   
Post new topic   Reply to topic    Team KgS Forum Index -> SA-MP -> Scripting SA-MP [Pawn] All times are GMT + 1 Hour
Page 1 of 1
Jump to:  
Xooit.com :: Top Forums
Index | Create a free forum | Free support forum | Free forums directory | Report a violation | Cookies | Charte | Conditions générales d'utilisation
Powered by phpBB © 2001, 2020 phpBB Group

Team KgS © 2010-2016 - copyright inscrit 00049334
mtechnik