GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: madinina972 le 10 Juin 2008, 21:45:43
-
bonjour,
j'ai trouvé un scipt qui m'interresse sur le form de sa-mp
mai le pb c'est que je c'est pas ces kel commandes ? regarder
/*
STINGER SCRIPT BY GROVE!
GO TO LINE 40 FOR THE OnPlayerCrossStinger CALLBACK AND HAVE FUN :P
(c)Jay 2008
To add a Stinger, Usage:
CreateStinger(stingerid,Float:x,Float:y,Float:z);
*/
#include <a_samp>
#define MAX_STINGER 2 //just increase it if you add more than 20 stingers.
#define white 0xFFFFFFAA
new MAXPLAYERS;
forward PlayerToPoint(Float:radi,playerid,Float:x,Float:y,Float:z);
forward stinger();
forward StopVehicle(playerid);
new sting[MAX_STINGER], Float:Rot[4][MAX_STINGER];
public OnFilterScriptInit()
{
//STINGERS:
CreateStinger(0,332.2, 2503.8, 15.8);
CreateStinger(1,332.2+15, 2503.8+15, 15.8);
//--
print("Stinger script 0.1 by Grove Loaded");
SetTimer("stinger",40,1); //checks if the player is near a stinger
MAXPLAYERS = GetMaxPlayers();
}
public OnFilterScriptExit()
{
for(new i = 0; i < MAX_STINGER; i++)
{
DestroyObject(sting);
}
print("Stinger script 0.1 by Grove unloaded!");
}
stock CreateStinger(id,Float:X,Float:Y,Float:Z)
{
sting[id] = CreateObject(1593,X,Y,Z,0,0,0);
GetObjectPos(sting[id],Rot[1][id],Rot[2][id],Rot[3][id]);
return id;
}
OnPlayerCrossStinger(playerid,stingerid) //do what you like here :)
{
if(!IsPlayerInAnyVehicle(playerid)) return false;
PlayerPlaySound(playerid,32000,0,0,0); //sound for popping tyres NOT SUPPORTED IN SA:MP
SetVehicleToRespawn((GetPlayerVehicleID(playerid)));
GameTextForPlayer(playerid,"~r~Pop goes the weasel!",5000,5);
//Perhaps here, you could freeze the vehicle, and remove the player from it!
#pragma unused stingerid
/* new string[256];
format(string,256,"DEBUG: stinger id: %d.",stingerid);
SendClientMessage(playerid,white,string);
*/
return true;
}
public stinger()
{
for(new i = 0; i < MAX_STINGER; i++)
{
for(new pi = 0; pi <MAXPLAYERS; pi++)
{
if(PlayerToPoint(1.2,pi,Rot[1],Rot[2],Rot[3]))
{
OnPlayerCrossStinger(pi,i);
}
}
}
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
-
Et tu veu quoi en fait ??
++
nikko
-
ba le pb c'est qu'il y a pa de comande donc on peut pa utilisé le script
-
Dans OnFilterScriptInit, règle la position des stingers. :)
Sinon pour définir ce que ça fait quand tu roule sur une stinger, règle dans OnPlayerCrossStinger(playerid,stingerid) :)
++
Alexandre
-
je met koi dedans je comprend pa tres bien :s
-
T'as pas besoin de commande, tu met le code dans ton GM en faisant attention avec les publics qui sont déjà dans ton GM (pour pas qu'ils y soient deux fois quoi :p )
Et en faite, quand tu ira sur ton serv, les stingers seront mis / missent (je ne sais pas trop ce que c'est ;)) aux positions ou tu les aura mis / missent. Mais tu n'as pas besoin de commande ^^
-
les stinger c'est des herce
bref
mai moi enfaite je voulais fire un truk ke kand je fi la cmd a un endroit les herce se mette a l'endroit ou je sui ;)
++
madinina_972