GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: dixon le 02 Novembre 2009, 16:09:35
-
Salut a tous, voilà j'explique mon problème, quand je vais sur le pickups où j'ai mis le gametext ne s'affiche pas voilà comment j'ai procédé, j'ai essaye plusieurs solution sa fessait la même chose :
if (strcmp(cmd, "/prendrearme", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(50,playerid,813.9904,-1108.2556,25.7881)) // Bat RP
{
SendClientMessage(playerid, COLOR_PURPLE, "Vous prenez la bat et sortez de la tombe pour continuer");
SetPlayerCheckpoint(playerid, 836.0901,-1101.8246,24.3040, 3.0);
GivePlayerWeapon(playerid,5,1);
}
else if (GetPlayerState(playerid) == 1 && PlayerToPoint(1.0, playerid,813.9904,-1108.2556,25.7881))
{
GameTextForPlayer(playerid, "~g~Vous pouvez prendre la bat en utilisant /prendrearme", 5000, 3);
}
}
return 1;
}
Et le problème c'est que je ne voit pas d'où sa vient, j'aurai besoin d'aide absolument pour mon nouveau projet !
Merci d'avance ...
-
Salut.
GetPlayerState n'est pas quand la personne est dans un véh ?
De plus, tu veux que sa s'affiche quand la personne est dessus et non pas quand elle tape une commande Donc dans Public CustomPickups() il faut que tu mette :
if (PlayerToPoint(1.0, i,813.9904,-1108.2556,25.7881))
{
GameTextForPlayer(i, "~g~Vous pouvez prendre la bat en utilisant /prendrearme", 5000, 3);
}
Dans ta commande /prendrearme, tu peux donc enlever la ligne else if ;)
-
le GetPlayerState a plusieur tour dans son sac :)
0 Empty (while initializing) - "PLAYER_STATE_NONE"
1 Player is on foot - "PLAYER_STATE_ONFOOT"
2 Player is driver of a vehicle - "PLAYER_STATE_DRIVER"
3 Player is passenger of a vehicle - "PLAYER_STATE_PASSENGER"
7 Player is wasted or on class selection - "PLAYER_STATE_WASTED"
8 Player is spawned - "PLAYER_STATE_SPAWNED"
9 Player is spectating - "PLAYER_STATE_SPECTATING"
-
le GetPlayerState a plusieur tour dans son sac :)
0 Empty (while initializing) - "PLAYER_STATE_NONE"
1 Player is on foot - "PLAYER_STATE_ONFOOT"
2 Player is driver of a vehicle - "PLAYER_STATE_DRIVER"
3 Player is passenger of a vehicle - "PLAYER_STATE_PASSENGER"
7 Player is wasted or on class selection - "PLAYER_STATE_WASTED"
8 Player is spawned - "PLAYER_STATE_SPAWNED"
9 Player is spectating - "PLAYER_STATE_SPECTATING"
Ok, merci pour ça, je pensais que ça servait surtout quand la personne était en Veh.
Dans ce cas Dixon, tu peux ajouter GetPlayerState(i) == 1 au bout de code que je t'ai donné, mais ça ne change sur l'endroit où il faut le mettre ;)
-
Merci, donc si je me trompe pas sa doit donner ceci
public CustomPickups(playerid)
{
if (PlayerToPoint(1.0, playerid,813.9904,-1108.2556,25.7881))
{
GameTextForPlayer(playerid, "~g~Vous pouvez prendre la bat en utilisant /prendrearme", 5000, 3);
}
return 1;
}
Mais pourtant sa ne marche toujourd pas ?
-
Dans mon public CustomPickups je n'ai rien entre les parenthèses.
Chez moi, il se présente donc comme ceci:
public CustomPickups()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerToPoint(1.0, i,813.9904,-1108.2556,25.7881))
{
GameTextForPlayer(i, "~g~Vous pouvez prendre la bat en utilisant /prendrearme", 5000, 3);
}
}
}
return 1;
}
-
re, de toute façon rien ne change i c'est la même chose que playerid ...
Le GameText ne s'affiche toujourd pas, que faire s'il vous plaît, merci ...
-
Tu as bien le forward CustomPickups() en haut de ton script ? Tu as bien lpickuptimer = SetTimer("CustomPickups", 1000, 1); dans public OnGameModeInit() ? Tu as bien ajouter for(new i = 0; i < MAX_PLAYERS; i++) dans public CustomPickups() ?
-
RE;RE, C'est bon j'ai trouvé d'où venez le probléme, merci quand même Diablo :)
Vous pouvez LOCK :lock
-
T'a fait quoi pour qu'il marche?