Quantcast
Channel: Forum VeryGames
Viewing all articles
Browse latest Browse all 5196

Roleplay cssrp

$
0
0
Bonjour , j'ai un petit soucis avec un code , que j'ai trouvé sur Verygames ( de Kupah )

Voici le code :

Code PHP:

#include <sourcemod>
#include <sdktools>

new Handle:h_timerBoisson[MAXPLAYERS+1] = INVALID_HANDLE,
    
Handle:h_timerCafe[MAXPLAYERS+1] = INVALID_HANDLE;

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if (
IsPlayerAlive(client))
    {
        new 
Float:entitypos[3], 
            
Float:clientpos[3],
            
Entity;
            
        
Entity GetClientAimTarget(clientfalse);
        
GetEntPropVector(EntityProp_Send"m_vecOrigin"entitypos);
        
GetEntPropVector(clientProp_Send"m_vecOrigin"clientpos);
        
        new 
Float:distance GetVectorDistance(entityposclientpos);
        
        if(
IsMachineBouffe(client))
        {
            if (
distance <= 90)
            {
                
MenuBouffe(client);
            }
        }
        else if(
IsMachineCafe(client))
        {
            if (
distance <= 90)
            {
                
MenuCafe(client);
            }
        }
        else if(
IsMachineBoisson(client))
        {
            if (
distance <= 90)
            {
                
MenuBoisson(client);
            }
        }
    }
}

public 
MenuBouffe(client)
{
    new 
Handle:menu CreateMenu(BouffeMenu);
    
SetMenuTitle(menu"Quelle boisson voulez-vous ?");
    
AddMenuItem(menu"bueno""Kinder Bueno - 2€");
    
AddMenuItem(menu"m&m""M&M's - 2€");
    
AddMenuItem(menu"maltesers""Maltesers - 4€");
    
AddMenuItem(menu"dragibus""Dragibus - 2€");
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
}

public 
MenuCafe(client)
{
    new 
Handle:menu CreateMenu(CafeMenu);
    
SetMenuTitle(menu"Quelle boisson voulez-vous ?");
    
AddMenuItem(menu"cafe""Café - 5€");
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
}

public 
MenuBoisson(client)
{
    new 
Handle:menu CreateMenu(BoissonMenu);
    
SetMenuTitle(menu"Quelle boisson voulez-vous ?");
    
AddMenuItem(menu"redbull""RedBull - 2€");
    
AddMenuItem(menu"coca""Coca Cola - 2€");
    
AddMenuItem(menu"tea""Ice-Tea - 2€");
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
}

public 
BouffeMenu(Handle:menuMenuAction:actionclientparam1)
{
    if(
action == MenuAction_Select)
    {
        
MenuBoisson(client);
    
        new 
String:Info[32];
        
GetMenuItem(menuparam1Infosizeof(Info));
        
        if(
StrEqual(Info"bueno"))
        {
            new 
hp GetClientHealth(client);
            new 
HealthEntity FindDataMapOffs(client"m_iHealth");
            
            
SetEntData(clientHealthEntityhp 1true);
            
SupMoney(client2);
        }
        else if(
StrEqual(Info"m&m"))
        {
            new 
hp GetClientHealth(client);
            new 
HealthEntity FindDataMapOffs(client"m_iHealth");
            
            
SetEntData(clientHealthEntityhp 1true);
            
SupMoney(client2);
        }
        else if(
StrEqual(Info"maltesers"))
        {
            new 
hp GetClientHealth(client);
            new 
HealthEntity FindDataMapOffs(client"m_iHealth");
            
            
SetEntData(clientHealthEntityhp 2true);
            
SupMoney(client4);
        }
        else if(
StrEqual(Info"dragibus"))
        {
            new 
hp GetClientHealth(client);
            new 
HealthEntity FindDataMapOffs(client"m_iHealth");
            
            
SetEntData(clientHealthEntityhp 1true);
            
SupMoney(client2);
        }
    }
    else if(
action == MenuAction_End)
    {
        
CloseHandle(menu);
    }
}

public 
CafeMenu(Handle:menuMenuAction:actionclientparam1)
{
    if(
action == MenuAction_Select)
    {
        
MenuBoisson(client);
    
        new 
String:Info[32];
        
GetMenuItem(menuparam1Infosizeof(Info));
        
        if(
StrEqual(Info"cafe"))
        {
            
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"1.2);
            
SupMoney(client5);
            
            
h_timerCafe[client] = CreateTimer(10.0OnCafeEndclient);
        }
    }
    else if(
action == MenuAction_End)
    {
        
CloseHandle(menu);
    }
}

public 
BoissonMenu(Handle:menuMenuAction:actionclientparam1)
{
    if(
action == MenuAction_Select)
    {
        
MenuBoisson(client);
    
        new 
String:Info[32];
        
GetMenuItem(menuparam1Infosizeof(Info));
        
        if(
StrEqual(Info"redbull"))
        {
            new 
hp GetClientHealth(client);
            new 
HealthEntity FindDataMapOffs(client"m_iHealth");
            
            
SetEntData(clientHealthEntityhp 1true);
            
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"1.1);
            
SupMoney(client2);
            
            
h_timerBoisson[client] = CreateTimer(10.0OnBoissonEndclient);
        }
        else if(
StrEqual(Info"coca"))
        {
            new 
hp GetClientHealth(client);
            new 
HealthEntity FindDataMapOffs(client"m_iHealth");
            
            
SetEntData(clientHealthEntityhp 1true);
            
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"1.1);
            
SupMoney(client2);
            
            
h_timerBoisson[client] = CreateTimer(10.0OnBoissonEndclient);
        }
        else if(
StrEqual(Info"tea"))
        {
            new 
hp GetClientHealth(client);
            new 
HealthEntity FindDataMapOffs(client"m_iHealth");
            
            
SetEntData(clientHealthEntityhp 1true);
            
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"1.1);
            
SupMoney(client2);
            
            
h_timerBoisson[client] = CreateTimer(10.0OnBoissonEndclient);
        }
    }
    else if(
action == MenuAction_End)
    {
        
CloseHandle(menu);
    }
}

public 
Action:OnCafeEnd(Handle:Timerany:client)
{
    
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"1.0);
    
    
KillTimer(h_timerCafe[client]);
    
h_timerCafe[client] = INVALID_HANDLE;
}

public 
Action:OnBoissonEnd(Handle:Timerany:client)
{
    
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"1.0);
    
    
KillTimer(h_timerBoisson[client]);
    
h_timerBoisson[client] = INVALID_HANDLE;
}

IsMachineBouffe(client)
{    
    new 
Float:pos[3];
    
GetEntPropVector(clientProp_Send"m_vecOrigin"pos);

    if (
pos[0] == -5126.0 && pos[1] == -18.0 && pos[2] == -59.6)
        return 
true;
    else if (
pos[0] == -2370.0 && pos[1] == 1971.0 && pos[2] == -259.6)
        return 
true;
    else if (
pos[0] == -2312.0 && pos[1] == 1971.0 && pos[2] == -259.6)
        return 
true;
    else if (
pos[0] == -888.0 && pos[1] == -1870.0 && pos[2] == -255.6)
        return 
true;
    else
        return 
false;
}

IsMachineCafe(client)
{    
    new 
Float:pos[3];
    
GetEntPropVector(clientProp_Send"m_vecOrigin"pos);

    if (
pos[0] == -6476.0 && pos[1] == -4879.0 && pos[2] == 70.0)
        return 
true;
    else
        return 
false;
}

IsMachineBoisson(client)
{    
    new 
Float:pos[3];
    
GetEntPropVector(clientProp_Send"m_vecOrigin"pos);

    if (
pos[0] == -6118.0 && pos[1] == -4454.0 && pos[2] == 64.2)
        return 
true;
    else if (
pos[0] == -4168.0 && pos[1] == -2942.0 && pos[2] == 4032.3)
        return 
true;
    else if (
pos[0] == -4112.0 && pos[1] == -2942.0 && pos[2] == 4032.3)
        return 
true;
    else if (
pos[0] == -4334.0 && pos[1] == -2916.0 && pos[2] == 4072.7)
        return 
true;
    else if (
pos[0] == -3604.0 && pos[1] == 224.0 && pos[2] == 96.2)
        return 
true;
    else
        return 
false;


Des que je le compile , j'ai ceci :

Citation:

//// spawnrp.sp
// C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin
g\spawnrp.sp(89) : error 017: undefined symbol "SupMoney"
// C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin
g\spawnrp.sp(97) : error 017: undefined symbol "SupMoney"
// C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin
g\spawnrp.sp(105) : error 017: undefined symbol "SupMoney"
// C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin
g\spawnrp.sp(113) : error 017: undefined symbol "SupMoney"
// C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin
g\spawnrp.sp(134) : error 017: undefined symbol "SupMoney"
// C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin
g\spawnrp.sp(161) : error 017: undefined symbol "SupMoney"
// C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin
g\spawnrp.sp(172) : error 017: undefined symbol "SupMoney"
// C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin
g\spawnrp.sp(183) : error 017: undefined symbol "SupMoney"
//
// 8 Errors.
//
// Compilation Time: 0,11 sec
// ----------------------------------------
Je suis sur CSSRP de Delachambre.

Je voudrais aussi savoir , si quelle qu'un pourrais essayer de faire un Pole emploi , sur la map a coter de l'armurerie , ou était la dame dans le VGRP dans le batiment , bah moi je le voudrais juste devant les portes du batiment :p Merci ,si vous voulais j'ai le code de celui de MGK dans le cssrp.sp

Merci de l'aide ! :)

Viewing all articles
Browse latest Browse all 5196