GTAOnline.net

San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: Bankai_Rodriguez le 17 Mars 2010, 20:30:05

Titre: Multiples questions
Posté par: Bankai_Rodriguez le 17 Mars 2010, 20:30:05
J'ai voulu modifier mon Gamemode (Godfather, pas LARP) pour y ajouter ceci :

new plname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plname, sizeof(plname));
    new astring[256];
    format(astring, sizeof(astring), "%s à rejoint West-Life.",plname);
    SendClientMessageToAll(COLOR_YELLOW, astring);
if(Security != 0)
{
    SendClientMessage(playerid, COLOR_YELLOW, "Host has broken one of the Agreement rules, action has been taken.");
    Kick(playerid);
    return 1;
}
    new namestring = strfind(plname, "_", true);
  if(namestring == -1)
{
SendClientMessage(playerid, COLOR_YELLOW2, "Département d'immigratio: Votre nom n'est pas acceptable.");
SendClientMessage(playerid, COLOR_YELLOW2, "Info: Votre nom doit être du type Prénom_Nom.");
Kick(playerid);
return 1;
}

Dans mon Godfather :

public OnPlayerConnect(playerid)
{
    new string[256];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    new astring[256];
    format(astring, sizeof(astring), "%s à rejoint West-Life.",PlayerName);
    SendClientMessageToAll(COLOR_YELLOW, astring);
if(Security != 0)
{
    SendClientMessage(playerid, COLOR_YELLOW, "Host has broken one of the Agreement rules, action has been taken.");
    Kick(playerid);
    return 1;
}
    new namestring = strfind(PlayerName, "_", true);
  if(namestring == -1)
{
SendClientMessage(playerid, COLOR_YELLOW2, "Département d'immigratio: Votre nom n'est pas acceptable.");
SendClientMessage(playerid, COLOR_YELLOW2, "Info: Votre nom doit être du type Prénom_Nom.");
Kick(playerid);
return 1;
}


Mais voici les erreurs....:

D:\Serveur local\gamemodes\Paradize.pwn(2175) : error 017: undefined symbol "PlayerName"
D:\Serveur local\gamemodes\Paradize.pwn(2175) : error 017: undefined symbol "PlayerName"
D:\Serveur local\gamemodes\Paradize.pwn(2175) : error 029: invalid expression, assumed zero
D:\Serveur local\gamemodes\Paradize.pwn(2175) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Titre: Re : Multiples questions
Posté par: FuSion le 17 Mars 2010, 20:35:14
Ajoute ça a ton code:

new PlayerName[64];
Titre: Re : Re : Multiples questions
Posté par: scott1 le 18 Mars 2010, 15:48:36
Ajoute ça a ton code:

new PlayerName[64];

Salut, perso je pense que new PlayerName[MAX_PLAYER_NAME];est plus juste.
Titre: Re : Multiples questions
Posté par: Bankai_Rodriguez le 20 Mars 2010, 11:13:09
Merci, cela fonctionne correctement !

Autre question :

J'ai téléchargé un FS sur SA-MP.com qui permet de changer le temps automatiquement (Weather)

Mais le soucis, c'est que le temps change trop rapidement et je ne trouve pas ou modifier cela

Voici le code : http://pastebin.com/bRznVwDg (http://pastebin.com/bRznVwDg)
Titre: Re : Multiples questions
Posté par: S!m le 20 Mars 2010, 15:07:01
Salut,

lit les commentaires, ils sont rarement là sans raison(s)
(ligne 40)

++Sim++
Titre: Re : Multiples questions
Posté par: Paradize le 20 Mars 2010, 15:11:57
Oui
Titre: Re : Multiples questions
Posté par: Bankai_Rodriguez le 20 Mars 2010, 16:22:57
Merci ! Tous fonctionne correctement

J'ai voulu allez trop vite et j'ai pas bien regardé les commentaires.

Autre question :

Je suis en train de mettre des grilles de Q.G en place
Elle fonctionne correctement mais j'aurais voulu rajouter une phrase en violet ( /me ) lorsque le joueur tape la commande ' /ouvrirgrille '

Alors j'ai rajouté celà "        format(string, sizeof(string), "* Racer'z %s prend sa télécommande et ouvre la grille", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE)
" comme ici :

public OnPlayerCommandText(playerid, cmdtext[])
{
    new sendername[MAX_PLAYER_NAME];
    new string[256];
    if (strcmp("/oracerz", cmdtext, true) == 0)
{
MoveObject(racerz, -2076.5801, 1338.5420, 1.2093, 5);
GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* Racer'z %s prend sa télécommande et ouvre la grille", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
    }
    if (strcmp("/fracerz", cmdtext, true) == 0)
{
MoveObject(racerz, -2076.580078125, 1338.5419921875, 9.7093315124512, 5);
SendClientMessage(playerid, COLOR_DBLUE, " %s sort et appuis sur la télécommande pour fermer la grille..");
return 1;
    }

return 0;
}

Voici l'erreur à la compilation :

D:\Serveur local\filterscripts\gatesracer.pwn(120) : error 004: function "ProxDetector" is not implemented
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Titre: Re : Multiples questions
Posté par: Paradize le 20 Mars 2010, 16:28:23
Rajoute cela tous en bas de ton FS ou GM :

public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(!BigEar[i])
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}//not connected
return 1;
}

Titre: Re : Multiples questions
Posté par: Bankai_Rodriguez le 20 Mars 2010, 18:05:14
Super ! Niquel merci !

Autre question :

J'ai changé le spawn des joueurs d'une faction. Quand le joueur ce connecte, la tête du joueur est tourné à un endroit que je souhaite pas..

J'aimerais qu'au spawn, mon joueur regarde devant lui.

Comment faire ?
Titre: Re : Multiples questions
Posté par: Bankai_Rodriguez le 20 Mars 2010, 18:17:54
Voici le code de mon spawn :

if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)//Spawn Racer'z
{
    SetPlayerToTeamColor(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, -2111.6235,1369.5684,16.1506); //-2192.3020,646.8816,49.4375);
    PlayerInfo[playerid][pInt] = 0;
    return 1;
}
Titre: Re : Multiples questions
Posté par: Spaggiari le 22 Mars 2010, 08:33:50
Va Ingame et fait /save là ou tu veut qu'il regarde ^^
Titre: Re : Multiples questions
Posté par: scott1 le 23 Mars 2010, 14:20:34
SetPlayerCameraPos(playerid, X,Y,Z); // D'ou le joueur regarde
SetPlayerCameraLookAt(playerid, X,Y,Z); // Vers ou le joueur regarde
Titre: Re : Multiples questions
Posté par: Bankai_Rodriguez le 23 Mars 2010, 16:26:30
if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)//Spawn Racer'z
{
    SetPlayerToTeamColor(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerCameraPos(playerid, -2111.6235,1369.5684,16.1506); // D'où le joueur regarde
                    SetPlayerCameraLookAt(playerid, X,Y,Z); // Vers ou le joueur regarde < JE MET QUOI ICI
    PlayerInfo[playerid][pInt] = 0;
    return 1;
}


Pas trop compris... ??? :)
Titre: Re : Multiples questions
Posté par: Spaggiari le 23 Mars 2010, 17:23:44
Bah tu met la position vers ou doit regarder le joueur, exemple :

Je /save sur le toit de la mairie de LS
Je /save en bas de la mairie

Le Joueur regardera :
En bas de la mairie depuis le toit de la mairie
Titre: Re : Multiples questions
Posté par: Bankai_Rodriguez le 26 Mars 2010, 17:34:47
Merci  :)

Autre question :

J'aurais voulu avoir de l'aide par rapport aux skins de factions dans le GM GF. Où est-ce qu'on change le skin du chef de Gang/Faction ? Où est-ce qu'on change les différents skins des différents Rangs ( Boss, Co-Directeur...ect ) ? Et les skins des Jobs ? Merci  :happy
Titre: Re : Multiples questions
Posté par: Oscar le 26 Mars 2010, 21:27:04
Si le joueur est chef d'un gang, alors, il aura tel skin.

C'est pas difficile?
Titre: Re : Multiples questions
Posté par: scott1 le 26 Mars 2010, 23:08:00
cherche les if(PlayerInfo[playerid][pRank] ....
Titre: Re : Multiples questions
Posté par: Bankai_Rodriguez le 27 Mars 2010, 08:15:33
Sa semble pas évident dans ma tête..attendez  ::)

D'abord, peut-on me dire à quoi sert celà :

new JoinPed[53][1] = {
{280},//POLICE_FORCE
{281},
{282},
{283},
{284},
{285},
{288},
{71},
{166},
{295},
{148},
{286},//FBI/ATF
{164},
{163},
{287},//NATIONAL_GUARD
{285},
{70},//FIRE/AMBULANCE
{274},
{275},
{276},
{277},
{278},
{279},
{258},//LA_COSA_NOSTRA
{127},
{126},
{125},
{124},
{113},
{111},
{98},
{185},//RACER'Z
{170},
{180},
{29},
{217},
{195},
{193},
{127},//HITMANS
{165},
{186},
{93},
{94},//CRIP'Z
{141},
{148},//NEWS_REPORTERS
{188},
{187},
{255},//TAXI_CAB_COMPANY
{253},
{59},//DRIVING/FLYING_SCHOOL
{60},//DRIVING/FLYING_SCHOOL
{76},//DRIVING/FLYING_SCHOOL
{150}//DRIVING/FLYING_SCHOOL
};
Titre: Re : Multiples questions
Posté par: scott1 le 27 Mars 2010, 13:05:03
tu a les id des skin des factions, en dessous des // FBI ...

jusqu'au suivant tu a les skin des faction
Titre: Re : Multiples questions
Posté par: Bankai_Rodriguez le 27 Mars 2010, 13:09:30
Ok merci :)