SA-MP Forums Archive
[Ajuda] speed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] speed (/showthread.php?tid=583360)



speed - leandr58 - 27.07.2015

queria coolocar minha fs dentro da gm pois to com muito fs para uzar na host
alguem me ajuda
#include <a_samp>
#define Dialogspeed
new EnableBoast[MAX_PLAYERS];

#if defined FILTERSCRIPT
}

public OnFilterScriptExit()

#endif




public OnPlayerSpawn(playerid)
{
EnableBoast[playerid] = 0;
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/speed", true))
{
if(EnableBoast[playerid])
{

EnableBoast[playerid] = 0; //will enable boast
SendClientMessage(playerid, 0x61FF00FF, "Super Speed desativado");
GameTextForPlayer(playerid,"~>~~w~/~G~/Speed desativado~<~",6000,4);

}
else
{
EnableBoast[playerid] = 1; //will enable boast
SendClientMessage(playerid, 0x61FF00FF, "Super Speed ativado.");
GameTextForPlayer(playerid,"~>~~w~/~G~/Speed ativado~<~",6000,4);
}
return 1;
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{

if(newkeys & KEY_FIRE)
{



if(EnableBoast[playerid] == 1)
{
new Float:vx,Float:vy,Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx ,vy,vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.;
}
}
}


if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if (newkeys & KEY_CROUCH)
{

if(EnableBoast[playerid] == 1)
{
new Float, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z);
SetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z+0.3);
}
}
}
return 1;
}


Re: speed - LockedLucas - 27.07.2015

Nunca ouviu fala em Ctrl + C e depois Ctrl + V ? isso serve pra copiar e colar as coisas... ou seja copia o fs e cola na sua gm... й cada um que aparece aqui....


Re: speed - iTakelot - 27.07.2015

Vai colocando os codigos na public como eu fiz:

Defina no topo:

PHP код:
#define Dialogspeed
new EnableBoast[MAX_PLAYERS]; 
Coloca em augum lugar da public OnPlayerSpawn .
PHP код:
    EnableBoast[playerid] = 0
depois vai na public OnPlayerCommandText e coloca

PHP код:
if(!strcmp(cmdtext"/speed"true))
{
    if(
EnableBoast[playerid])
    {
        
EnableBoast[playerid] = 0//will enable boast
        
SendClientMessage(playerid0x61FF00FF"Super Speed desativado");
        
GameTextForPlayer(playerid,"~>~~w~/~G~/Speed desativado~<~",6000,4);
        }else{
        
EnableBoast[playerid] = 1//will enable boast
        
SendClientMessage(playerid0x61FF00FF"Super Speed ativado.");
        
GameTextForPlayer(playerid,"~>~~w~/~G~/Speed ativado~<~",6000,4);
        }
        return 
1;

Vai na public OnPlayerKeyStateChange e coloca

PHP код:
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    if(
newkeys KEY_FIRE)
    {
        if(
EnableBoast[playerid] == 1)
        {
            new 
Float:vx,Float:vy,Float:vz;
            
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx ,vy,vz);
            
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx 1.8vy *1.8vz 1.;
            }
        }
    }
    if (
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if (
newkeys KEY_CROUCH)
        {
            if(
EnableBoast[playerid] == 1)
            {
                new 
FloatFloat:yFloat:z;
                
GetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z);
                
SetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z+0.3);
                }
            }
        } 



Re: speed - leandr58 - 28.07.2015

cara ta dando 26 erros