[Ajuda] speed
#1

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;
}
Reply
#2

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....
Reply
#3

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);
                }
            }
        } 
Reply
#4

cara ta dando 26 erros
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)