Myths in SA:MP - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Myths in SA:MP (
/showthread.php?tid=114448)
Myths in SA:MP -
ziomal432 - 19.12.2009
I want to show you frauds in wiki.sa-mp.com.
1. AddStaticVehicle works not only in OnGameModeInit.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/hydra", true))
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
AddStaticVehicle(520, X, Y, Z, A, 0, 0);
return 1;
}
return 0;
}
Vehicle shows up and works good.
2. AddStaticVehicle returns ID of created vehicle.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/hydra", true))
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
printf("%d", AddStaticVehicle(520, X, Y, Z, A, 0, 0));
return 1;
}
return 0;
}
After few uses of this command, console shows:
Quote:
[12:41:56] 1
[12:42:04] 2
[12:42:08] 3
[12:42:16] 4
|
3. Removing vehicles created with AddStaticVehicle:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/hydra", true))
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
printf("%d", AddStaticVehicle(520, X, Y, Z, A, 0, 0));
return 1;
}
if(!strcmp(cmdtext, "/d", true, 2))
{
printf("%d", strval(cmdtext[3]));
DestroyVehicle(strval(cmdtext[3]));
return 1;
}
return 0;
}
Worked good.
Re: Myths in SA:MP -
saiberfun - 19.12.2009
erm and now the world blows up?
jk
but wayne that post was useless
it sumin everyone should kno tho..
no real myths XD
Re: Myths in SA:MP -
MPKaboose - 19.12.2009
1) thats normal
2) Thats what it should do
3) AddStaticVehicle and CreateVehicle can both be removed whit that
so no myths here
Re: Myths in SA:MP -
ziomal432 - 19.12.2009
I say about myths in wiki.sa-mp.com.
https://sampwiki.blast.hk/wiki/AddStaticVehicle
Quote:
This function can only create vehicles in the OnGameModeInit callback, and vehicles created with this function cannot be removed
|
Quote:
This function does not return a specific value, it's best to simply ignore it.
|
Quote:
If you've found problems - CHANGE THEM
|
Registration is locked, cannot change it without account.