GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: Blackdown le 22 Janvier 2011, 21:25:00
-
Bonsoir,
Voila, depuis le passage de mon GM en version 0.3c, plus aucune commande de téléportation ne marche. Ni la commande pour redonner de la vie à tout le monde et d'autres ...
Voici les codes:
if(strcmp(cmd, "/tpsf", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 2000)
{
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, -1417.0,-295.8,14.1);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid, -1417.0,-295.8,14.1);
}
SendClientMessage(playerid, COLOR_GRAD1, " Téléporté !");
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vous n'êtes pas autoriser a utiliser cette commande!");
}
}
return 1;
}
Et la commande de vie pour tous:
if( strcmp( cmdtext, "/vieall" ) == 0 )
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( IsPlayerConnected( i ) )
SetPlayerHealth( i, 100.0 );
}
SendClientMessageToAll( COLOR_YELLOW, "Un miracle c'est produit,vous guerissez !");
}
}
Elle marchaient avant donc ce n'est pas un problème de commande. Du moins, je ne pense pas.
Cordialement
-
Salut,
la section pour ce genre de problèmes est Scripting SA-MP, pas Problèmes et bugs
Je déplace ;)
++Sim++
-
Merci, désolé de m'être trompé.
Cordialement
-
Dans le deuxième code, il y a une accolade qui se balade. C'est normal ? Du moin moi je le l'aurai coller au code !
-
La commande était bien fonctionnelle avant donc aucun problème. Après c'est la disposition sur le forum qui fait sa surement ^^
-
Donc je n'ai rien dit mais c'est bizzare tout de même regarde en haut de ton script si tu n'a pas oublié ça : {
-
La commande était bien fonctionnelle avant donc aucun problème. Après c'est la disposition sur le forum qui fait sa surement ^^
Toujours le forum !
Mais moi, quand je compile c'est bourré d'erreur. Peut-être que j'ai fait une erreur avec le PlayerInfo !
-
La commande était bien fonctionnelle avant donc aucun problème. Après c'est la disposition sur le forum qui fait sa surement ^^
Toujours le forum !
Mais moi, quand je compile c'est bourré d'erreur. Peut-être que j'ai fait une erreur avec le PlayerInfo !
Quand tu compile ? Tu as ajouté ma commande à ton GM ?
-
Pourquoi utiliser ce code ? Il sert strictement à rien :
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
if( strcmp( cmdtext, "/tpsf" ) == 0 )
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 2000)
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVE)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, -1417.0,-295.8,14.1);
PutPlayerInVehicle(playerid, tmpcar);
LinkVehicleToInterior(tmpcar, 0);
}
else
{
SetPlayerPos(playerid, -1417.0,-295.8,14.1);
}
SendClientMessage(playerid, COLOR_GRAD1, "Téléporté à San Fierro!");
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vous n'êtes pas autorisé à utiliser cette commande!"); // En français correct ça le fait mieux ;)
}
return 1;
}
}
Et la commande de vie pour tous:
if( strcmp( cmdtext, "/vieall" ) == 0 )
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected( i )) SetPlayerHealth(i, 100.0);
}
SendClientMessageToAll(COLOR_YELLOW, "Un miracle s'est produit, votre santé est restaurée !");
}
}
Si là ça ne marche pas, c'est autre part dans ton code que s'est bugé.
Regardes mon code et compares-le avec le tiens, tu verras.
PS : As-tu des erreurs ?
-
Non, aucune erreur lors de la compilation...
edit: J'ai des erreurs quand je met ton code de la commande /tpsf.
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2620) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2673) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2677) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2689) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2693) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2697) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2701) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2705) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2709) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2713) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2725) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2729) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2733) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2737) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2741) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2753) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2757) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2761) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2773) : error 004: function "PlayerToPoint" is not implemented
D:\Sauvegardes\American Life\gamemodes\SFRole.pwn(2777) : error 004: function "PlayerToPoint" is not implemented
-
if( strcmp( cmdtext, "/tpsf" ) == 0 )
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 2000)
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVE)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, -1417.0,-295.8,14.1);
PutPlayerInVehicle(playerid, tmpcar);
LinkVehicleToInterior(tmpcar, 0);
}
else
{
SetPlayerPos(playerid, -1417.0,-295.8,14.1);
}
SendClientMessage(playerid, COLOR_GRAD1, "Téléporté à San Fierro!");
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vous n'êtes pas autorisé à utiliser cette commande!"); // En français correct ça le fait mieux
}
return 1;
}
}
Regardes mieux le code, j'ai "juste" oublié une accolade pour fermer le if(PlayerInfo...)
-
Sa ne marche pas quand même ...