DCMD Help!
#1

Hello again! OK, i have a question about DCMD thinks... For example on this script:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     dcmd(test, 4, cmdtext); // why 4 and not 6?
     return 0;
}


dcmd_test(playerd, params[])
{
     print("Hello");
     return 1;
}
It have dcmd(test, 4, cmdtext) // Why 4 and not 6 for example? and how to define what cmd do? How cmd know what to do? I want to make a setmoney cmd but i realy can't....... Please explain me something about this type od cmds
Reply
#2

Quote:
Originally Posted by Ricardo187
Посмотреть сообщение
Hello again! OK, i have a question about DCMD thinks... For example on this script:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     dcmd(test, 4, cmdtext); // why 4 and not 6?
     return 0;
}


dcmd_test(playerd, params[])
{
     print("Hello");
     return 1;
}
It have dcmd(test, 4, cmdtext) // Why 4 and not 6 for example? and how to define what cmd do? How cmd know what to do? I want to make a setmoney cmd but i realy can't....... Please explain me something about this type od cmds
T E S T = 4 characters, Not 6


pawn Код:
dcmd_setcash(playerid, params[])
{

   new nome_playerid[30],nome_id[30]; GetPlayerName(playerid, nome_playerid, 30); GetPlayerName(playerid, nome_id, 30);
   new id, tmp[256], tmp2[256], Index; new string[128]; new cash;
   tmp = strtok(params,Index); new string3[128]; new string4[128];
   tmp2 = strtok(params,Index);
   id = strval(tmp);
   cash = strval(tmp2);
   format(string,sizeof(string),"Level minimo requerido й 3. O seu й %d, embora", PlayerInfo[playerid][Level]);
   if(PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid, VERMELHO, string);
   if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, VERMELHO, "USAGE: /setcash <ID>");
   if(!IsPlayerConnected(id)) SendClientMessage(playerid, VERMELHO, "Player selecionado estб offline");
   format(string3,sizeof(string3),"Vocк mudou o dinheiro de %s para %d", nome_id, cash);
   format(string4,sizeof(string4),"ADMIN %s setou seu dinheiro para %d", nome_playerid, cash);
   ResetPlayerMoney(id) && GivePlayerMoney(id, cash) && SendClientMessage(playerid, AZUL, string3) && SendClientMessage(id, AZUL, string4);

   return 1;
}
Reply
#3

Thanks very mutch It only give a warn....

Код:
C:\Users\Ricardo\Desktop\RR-RP.pwn(508) : warning 203: symbol is never used: "dcmd_setcash"
Reply
#4

the '4' means the number of characters in the cmd

I don't suggest you use dcmd, its slower than ZCMD

but here is a dcmd + sscanf setcash command

pawn Код:
dcmd_setcash(playerid, params[])
{
    new PID, Cash;
    if(sscanf(params, "ui", PID, Cash)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /SetCash < PlayerID > < Cash >");
    if(!IsPlayerConnected(PID)) return 0;

    SetPlayerMoney(PID, Cash);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
     dcmd(setcash, 7, cmdtext);
     return 0;
}
Reply
#5

When i put the fricken:

pawn Код:
{
    dcmd(money, 5, cmdtext);
    return 0;
}
It come this errors/warns:
Код:
C:\Users\Ricardo\Desktop\Meu GM\MeuGm\gamemodes\RR-RP.pwn(316) : error 010: invalid function or declaration
C:\Users\Ricardo\Desktop\Meu GM\MeuGm\gamemodes\RR-RP.pwn(317) : error 010: invalid function or declaration
C:\Users\Ricardo\Desktop\Meu GM\MeuGm\gamemodes\RR-RP.pwn(502) : warning 203: symbol is never used: "dcmd_setcash"
GM code is this:
pawn Код:
#include <a_samp>
#include <file>
#include <a_samp>
#include <mapicon>
#include <newf>
#include <dcmd>
#include <cpstream>
#include <md5>
#include <streamer>

#pragma dynamic 145000
//-----------------------------------------------------------------
main()
{
    print("\n----------------------------------");
    print(" RR-RP by Ricardo_Rodrigues");
    print("----------------------------------\n");
}
//-----------------------------------------------------------------
#define MAX_SLOTS 30
#define OWNER_NAME "Ricardo_Rodrigues
#define DEFINE_NAME INT"
#define SendMessage(%0, %1, %2)
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//---------------[COLORS/TEAMS]------------------------------------------
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_SYSTEM 0xFFA500AA
#define COLOR_SUSPECT 0xFF8000AA
#define COLOR_NEWS 0x0259EAAA
#define COLOR_DARKRED 0x8B0000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PINK 0xDC00DDAA
#define COLOR_BLUE 0x0259EAAA
#define COLOR_GREEN 0x00A800AA
#define COLOR_ORANGE 0xFF8000AA
#define COLOR_CYAN 0xFF8080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKBLUE 0x0000A0AA
#define COLOR_BLACK 0x000000AA
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_PURPLE 0xFF00FFAA
#define COLOR_BROWN 0x804000AA

#define TEAMCOLOR_NONE 0xAFAFAFAA
#define TEAMCOLOR_GROVE 0x00A800AA
#define TEAMCOLOR_BALLAS 0xFF00FFAA
#define TEAMCOLOR_AZTECAS 0x33CCFFAA
#define TEAMCOLOR_VAGOS 0xFFFF00AA
#define TEAMCOLOR_RIFA 0x33CCFFAA
#define TEAMCOLOR_BIKER 0xFF0080AA
#define TEAMCOLOR_FIREMAN 0xB22222AA
#define TEAMCOLOR_MEDIC 0x87CEEBAA
#define TEAMCOLOR_COP 0x0259EAAA
#define TEAMCOLOR_NORMAL 0xFFFFFFAA
#define TEAMCOLOR_ARMY 0x556B2FAA
#define TEAMCOLOR_NEWS 0x3CB371AA

#define TEAM_NONE 0
#define TEAM_GROVE 1
#define TEAM_BALLAS 2
#define TEAM_AZTECAS 3
#define TEAM_VAGOS 4
#define TEAM_RIFA 5
#define TEAM_BIKER 6
#define TEAM_MEDIC 7
#define TEAM_FIREMAN 8
#define TEAM_COP 9
#define TEAM_NORMAL 10
#define TEAM_ARMY 11
#define TEAM_NEWS 12
//---------------[COLORS FROM SEIFADMIN]---------------------------
#define GREEN       0x21DD00FF
#define RED         0xE60000FF
#define ADMIN_RED   0xFB0000FF
#define YELLOW      0xFFFF00FF
#define ORANGE      0xF97804FF
#define LIGHTRED    0xFF8080FF
#define LIGHTBLUE   0x00C2ECFF
#define PURPLE      0xB360FDFF
#define BLUE        0x1229FAFF
#define LIGHTGREEN  0x38FF06FF
#define DARKPINK    0xE100E1FF
#define DARKGREEN   0x008040FF
#define AQUAGREEN   0x00CACAFB
#define NICESKY     0x99FFFFAA
#define GREY        0xCECECEFF
#define WHITE       0xFFFFFFFF

#define blue 0x375FFFFF
#define red 0xFF0000AA
#define green 0x33FF33AA
#define yellow 0xFFFF00AA
#define grey 0xC0C0C0AA
#define blue1 0x2641FEAA
#define lightblue 0x33CCFFAA
#define orange 0xFF9900AA
#define black 0x2C2727AA
#define COLOR_BLACK 0x000000AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREEN1 0x33AA33AA

new Engine[MAX_VEHICLES];

forward EngineTimer(playerid);

public OnGameModeInit()
{
    SetGameModeText("RR-RP");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    CreateVehicle(560,1458.22680664,-689.31628418,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1461.23596191,-689.23840332,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1464.32092285,-689.54199219,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1467.10156250,-689.59094238,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1469.88305664,-689.48138428,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1472.78466797,-689.56939697,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1475.73168945,-689.84423828,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1458.00366211,-661.24444580,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1461.49328613,-661.11932373,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1464.99438477,-660.99377441,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1468.50305176,-661.01556396,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1471.38378906,-661.18078613,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1458.44067383,-675.12835693,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1461.55883789,-674.93762207,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1464.69641113,-674.85156250,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1467.72375488,-674.87042236,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1470.88073730,-674.67810059,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1473.90563965,-674.80303955,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1474.59802246,-661.34759521,94.55497742,0.00000000,-1,1,1500); //Sultan

    AddStaticVehicleEx(405,2228.00073242,-1176.99145508,25.72656250,92.00000000,6,6,15); //Sentinel
    AddStaticVehicleEx(405,2227.89160156,-1173.49658203,25.72656250,90.00000000,3,1,15); //Sentinel
    AddStaticVehicleEx(546,2227.98168945,-1166.62683105,25.58635330,90.00000000,106,1,15); //Intruder
    AddStaticVehicleEx(546,2228.04223633,-1170.01623535,25.56841087,90.00000000,114,1,15); //Intruder
    AddStaticVehicleEx(471,2214.75927734,-1169.10998535,25.30156326,90.00000000,-1,-1,15); //Quad
    AddStaticVehicleEx(471,2218.79663086,-1172.00024414,25.30156326,90.00000000,3,3,15); //Quad
    AddStaticVehicleEx(471,2214.80639648,-1171.89746094,25.30156326,90.00000000,-1,-1,15); //Quad
    AddStaticVehicleEx(471,2218.61938477,-1169.10791016,25.30156326,90.00000000,3,3,15); //Quad
    AddStaticVehicleEx(436,2216.69628906,-1157.86755371,25.60455513,90.00000000,93,1,15); //Previon
    AddStaticVehicleEx(436,2216.23999023,-1166.27697754,25.60455513,90.00000000,86,1,15); //Previon
    AddStaticVehicleEx(436,2216.16894531,-1162.10058594,25.60455513,90.00000000,61,1,15); //Previon
    AddStaticVehicleEx(527,2227.65405273,-1162.72326660,25.54477692,90.00000000,62,1,15); //Cadrona
    AddStaticVehicleEx(527,2227.93872070,-1152.97583008,25.62001038,90.00000000,66,1,15); //Cadrona
    AddStaticVehicleEx(527,2227.69970703,-1156.30371094,25.59219170,90.00000000,3,1,15); //Cadrona
    AddStaticVehicleEx(462,2203.83178711,-1176.07348633,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2205.33032227,-1175.97143555,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2206.80834961,-1175.89965820,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2208.27319336,-1175.90820312,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2203.71093750,-1171.88586426,25.40244102,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2205.08984375,-1171.90527344,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2206.53295898,-1171.85717773,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2208.02246094,-1171.86645508,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(581,2203.59106445,-1168.10656738,25.43626022,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2205.08520508,-1168.09228516,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2206.50097656,-1168.05078125,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2207.92675781,-1168.12915039,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2208.00585938,-1164.18737793,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2206.68896484,-1164.18066406,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2205.30371094,-1164.06457520,25.43184280,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2203.83203125,-1164.03955078,25.43905449,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(507,2205.77075195,-1160.74291992,25.68304634,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2205.83227539,-1153.53881836,25.68978310,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2206.00488281,-1156.87280273,25.68568420,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2135.31372070,-1141.64477539,25.10777092,0.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2116.79467773,-1151.30236816,24.37163544,0.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(551,2135.69506836,-1129.77795410,25.52692223,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2126.41406250,-1141.88195801,24.94487572,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2119.04907227,-1129.85498047,25.20104599,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2121.09472656,-1151.64074707,23.91438675,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(580,1775.21545410,-1060.92016602,23.86846161,0.00000000,-1,-1,15); //Stafford
    AddStaticVehicleEx(445,1770.82995605,-1060.26843262,23.95093727,0.00000000,-1,-1,15); //Admiral
    AddStaticVehicleEx(445,1784.41284180,-1060.60559082,23.95093727,0.00000000,-1,-1,15); //Admiral
    AddStaticVehicleEx(575,1788.75000000,-1060.89147949,23.70093727,0.00000000,-1,-1,15); //Broadway
    AddStaticVehicleEx(546,1793.11547852,-1061.27575684,23.80278587,0.00000000,-1,-1,15); //Intruder
    AddStaticVehicleEx(546,1771.42822266,-1069.39794922,23.80278587,0.00000000,-1,-1,15); //Intruder
    AddStaticVehicleEx(540,1762.43652344,-1060.82360840,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1753.28491211,-1046.84643555,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1762.11145020,-1046.75854492,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1780.08581543,-1069.31420898,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1788.75891113,-1069.08166504,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1757.68737793,-1037.99804688,23.94043922,179.99963379,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1505.85107422,-1750.89733887,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1509.48144531,-1750.87683105,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1456.82458496,-1750.22265625,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1452.82092285,-1750.36853027,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(596,1535.63977051,-1666.76635742,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1535.59960938,-1678.36694336,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1551.74267578,-1614.70031738,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1555.20043945,-1614.87866211,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1558.44396973,-1615.00390625,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1561.68725586,-1615.06262207,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1565.02331543,-1614.94067383,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1568.47241211,-1614.91613770,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1571.61572266,-1615.12951660,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1575.02124023,-1615.11669922,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(427,1591.12182617,-1710.61511230,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1594.79626465,-1710.45642090,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1587.14685059,-1710.29882812,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1583.18273926,-1710.10070801,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1578.79370117,-1709.84423828,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1574.03100586,-1709.80981445,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1569.95654297,-1709.86560059,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1559.53906250,-1710.16638184,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(411,1530.06079102,-1684.61120605,5.69062471,272.00000000,-1,-1,15); //Infernus
    AddStaticVehicleEx(411,1530.25805664,-1688.31982422,5.69062471,272.00000000,-1,-1,15); //Infernus
    return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid,2229.348388,-1159.111653,25.806554);
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(0xFFFF00AA, str);
        return 1;
    }
    return 0;

    dcmd(exitveh, 7, cmdtext);
    dcmd(engine, 6, cmdtext);
    return 0;
}
dcmd_engine(playerid, params[])
{
    #pragma unused params
    new vehicleid = GetPlayerVehicleID(playerid);
    if(Engine[vehicleid] == 0)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Engine Starting...");
    SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
    }
    else if(Engine[vehicleid] == 1)
    {
    Engine[vehicleid] = 0;
    SendClientMessage(playerid, COLOR_RED, "Engine Stopped...");
    SendClientMessage(playerid, COLOR_YELLOW, "To exit the vehicle press (F Key) Or (Enter)");
    SendClientMessage(playerid, COLOR_YELLOW, "Press (Shift) or Type (/engine) to start the vehicles engine");
    TogglePlayerControllable(playerid,0);
    }
    return 1;
}

dcmd_exitveh(playerid, params[])
{
        #pragma unused params
        if(IsPlayerInAnyVehicle(playerid))
        {
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid, 1);
        }
        else
        {
        SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle");
        }
        return 1;
}
dcmd_money(playerid, params[])
{
    new PID, Cash;
    if(sscanf(params, "ui", PID, Cash)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /money < PlayerID > < Cash >");
    if(!IsPlayerConnected(PID)) return 0;

    SetPlayerMoney(PID, Cash);
    return 1;
}

     dcmd(money, 5, cmdtext);
     return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SendClientMessage(playerid, 0x1229FAFF, " [RR-RP]You are entering a State car! Drive careful!");
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    SendClientMessage(playerid, 0x1229FAFF, "[RR-RP]You Leaved the car, DON'T Forget to park it rigth!");
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
  new vehicleid = GetPlayerVehicleID(playerid);
  if(Engine[vehicleid] == 0)
  {
  TogglePlayerControllable(playerid, 0);
  SendClientMessage(playerid, COLOR_YELLOW, "Press (Shift) or Type (/engine) to start the vehicles engine");
  }
  else if(Engine[vehicleid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Engine Running...");
    }
}
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid))
    {
    if(Engine[vehicleid] == 0)
    {
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid, 1);
    }
    else if(newkeys & KEY_JUMP)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Engine Starting...");
    SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
    }
    }
    }
    return 1;
    }

public EngineTimer(playerid)
{
    new rand = random(2);

    if(rand == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "Engine Started...");
        SendClientMessage(playerid, COLOR_YELLOW, "To turn off the vehicle, Type (/engine)");
        new vehicleid = GetPlayerVehicleID(playerid);
        Engine[vehicleid] = 1;
        TogglePlayerControllable(playerid, 1);
    }
    else if(rand == 1) //else if instead of 'if'
    {
        SendClientMessage(playerid, COLOR_GREEN, "Engine Failed...");
        SendClientMessage(playerid, COLOR_YELLOW, "Try Again");
    }
}
public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}
public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Reply
#6

It will be OnPlayerCommandText like this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     dcmd(setcash, 7, cmdtext);
     return 0;
}
Just delete the undefined simbols, because I use this command according my enums and dini
Reply
#7

1 error solved... Now i have this one and this warn:

Код:
C:\Users\Ricardo\Desktop\Meu GM\MeuGm\gamemodes\RR-RP.pwn(313) : error 017: undefined symbol "SetPlayerMoney"
GM code with the errors:
pawn Код:
#include <a_samp>
#include <file>
#include <a_samp>
#include <mapicon>
#include <newf>
#include <dcmd>
#include <cpstream>
#include <md5>
#include <streamer>

#pragma dynamic 145000
//-----------------------------------------------------------------
main()
{
    print("\n----------------------------------");
    print(" RR-RP by Ricardo_Rodrigues");
    print("----------------------------------\n");
}
//-----------------------------------------------------------------
#define MAX_SLOTS 30
#define OWNER_NAME "Ricardo_Rodrigues
#define DEFINE_NAME INT"
#define SendMessage(%0, %1, %2)
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//---------------[COLORS/TEAMS]------------------------------------------
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_SYSTEM 0xFFA500AA
#define COLOR_SUSPECT 0xFF8000AA
#define COLOR_NEWS 0x0259EAAA
#define COLOR_DARKRED 0x8B0000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PINK 0xDC00DDAA
#define COLOR_BLUE 0x0259EAAA
#define COLOR_GREEN 0x00A800AA
#define COLOR_ORANGE 0xFF8000AA
#define COLOR_CYAN 0xFF8080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKBLUE 0x0000A0AA
#define COLOR_BLACK 0x000000AA
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_PURPLE 0xFF00FFAA
#define COLOR_BROWN 0x804000AA

#define TEAMCOLOR_NONE 0xAFAFAFAA
#define TEAMCOLOR_GROVE 0x00A800AA
#define TEAMCOLOR_BALLAS 0xFF00FFAA
#define TEAMCOLOR_AZTECAS 0x33CCFFAA
#define TEAMCOLOR_VAGOS 0xFFFF00AA
#define TEAMCOLOR_RIFA 0x33CCFFAA
#define TEAMCOLOR_BIKER 0xFF0080AA
#define TEAMCOLOR_FIREMAN 0xB22222AA
#define TEAMCOLOR_MEDIC 0x87CEEBAA
#define TEAMCOLOR_COP 0x0259EAAA
#define TEAMCOLOR_NORMAL 0xFFFFFFAA
#define TEAMCOLOR_ARMY 0x556B2FAA
#define TEAMCOLOR_NEWS 0x3CB371AA

#define TEAM_NONE 0
#define TEAM_GROVE 1
#define TEAM_BALLAS 2
#define TEAM_AZTECAS 3
#define TEAM_VAGOS 4
#define TEAM_RIFA 5
#define TEAM_BIKER 6
#define TEAM_MEDIC 7
#define TEAM_FIREMAN 8
#define TEAM_COP 9
#define TEAM_NORMAL 10
#define TEAM_ARMY 11
#define TEAM_NEWS 12
//---------------[COLORS FROM SEIFADMIN]---------------------------
#define GREEN       0x21DD00FF
#define RED         0xE60000FF
#define ADMIN_RED   0xFB0000FF
#define YELLOW      0xFFFF00FF
#define ORANGE      0xF97804FF
#define LIGHTRED    0xFF8080FF
#define LIGHTBLUE   0x00C2ECFF
#define PURPLE      0xB360FDFF
#define BLUE        0x1229FAFF
#define LIGHTGREEN  0x38FF06FF
#define DARKPINK    0xE100E1FF
#define DARKGREEN   0x008040FF
#define AQUAGREEN   0x00CACAFB
#define NICESKY     0x99FFFFAA
#define GREY        0xCECECEFF
#define WHITE       0xFFFFFFFF

#define blue 0x375FFFFF
#define red 0xFF0000AA
#define green 0x33FF33AA
#define yellow 0xFFFF00AA
#define grey 0xC0C0C0AA
#define blue1 0x2641FEAA
#define lightblue 0x33CCFFAA
#define orange 0xFF9900AA
#define black 0x2C2727AA
#define COLOR_BLACK 0x000000AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREEN1 0x33AA33AA

new Engine[MAX_VEHICLES];

forward EngineTimer(playerid);

public OnGameModeInit()
{
    SetGameModeText("RR-RP");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    CreateVehicle(560,1458.22680664,-689.31628418,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1461.23596191,-689.23840332,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1464.32092285,-689.54199219,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1467.10156250,-689.59094238,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1469.88305664,-689.48138428,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1472.78466797,-689.56939697,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1475.73168945,-689.84423828,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1458.00366211,-661.24444580,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1461.49328613,-661.11932373,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1464.99438477,-660.99377441,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1468.50305176,-661.01556396,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1471.38378906,-661.18078613,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1458.44067383,-675.12835693,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1461.55883789,-674.93762207,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1464.69641113,-674.85156250,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1467.72375488,-674.87042236,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1470.88073730,-674.67810059,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1473.90563965,-674.80303955,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1474.59802246,-661.34759521,94.55497742,0.00000000,-1,1,1500); //Sultan

    AddStaticVehicleEx(405,2228.00073242,-1176.99145508,25.72656250,92.00000000,6,6,15); //Sentinel
    AddStaticVehicleEx(405,2227.89160156,-1173.49658203,25.72656250,90.00000000,3,1,15); //Sentinel
    AddStaticVehicleEx(546,2227.98168945,-1166.62683105,25.58635330,90.00000000,106,1,15); //Intruder
    AddStaticVehicleEx(546,2228.04223633,-1170.01623535,25.56841087,90.00000000,114,1,15); //Intruder
    AddStaticVehicleEx(471,2214.75927734,-1169.10998535,25.30156326,90.00000000,-1,-1,15); //Quad
    AddStaticVehicleEx(471,2218.79663086,-1172.00024414,25.30156326,90.00000000,3,3,15); //Quad
    AddStaticVehicleEx(471,2214.80639648,-1171.89746094,25.30156326,90.00000000,-1,-1,15); //Quad
    AddStaticVehicleEx(471,2218.61938477,-1169.10791016,25.30156326,90.00000000,3,3,15); //Quad
    AddStaticVehicleEx(436,2216.69628906,-1157.86755371,25.60455513,90.00000000,93,1,15); //Previon
    AddStaticVehicleEx(436,2216.23999023,-1166.27697754,25.60455513,90.00000000,86,1,15); //Previon
    AddStaticVehicleEx(436,2216.16894531,-1162.10058594,25.60455513,90.00000000,61,1,15); //Previon
    AddStaticVehicleEx(527,2227.65405273,-1162.72326660,25.54477692,90.00000000,62,1,15); //Cadrona
    AddStaticVehicleEx(527,2227.93872070,-1152.97583008,25.62001038,90.00000000,66,1,15); //Cadrona
    AddStaticVehicleEx(527,2227.69970703,-1156.30371094,25.59219170,90.00000000,3,1,15); //Cadrona
    AddStaticVehicleEx(462,2203.83178711,-1176.07348633,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2205.33032227,-1175.97143555,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2206.80834961,-1175.89965820,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2208.27319336,-1175.90820312,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2203.71093750,-1171.88586426,25.40244102,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2205.08984375,-1171.90527344,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2206.53295898,-1171.85717773,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2208.02246094,-1171.86645508,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(581,2203.59106445,-1168.10656738,25.43626022,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2205.08520508,-1168.09228516,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2206.50097656,-1168.05078125,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2207.92675781,-1168.12915039,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2208.00585938,-1164.18737793,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2206.68896484,-1164.18066406,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2205.30371094,-1164.06457520,25.43184280,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2203.83203125,-1164.03955078,25.43905449,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(507,2205.77075195,-1160.74291992,25.68304634,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2205.83227539,-1153.53881836,25.68978310,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2206.00488281,-1156.87280273,25.68568420,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2135.31372070,-1141.64477539,25.10777092,0.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2116.79467773,-1151.30236816,24.37163544,0.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(551,2135.69506836,-1129.77795410,25.52692223,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2126.41406250,-1141.88195801,24.94487572,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2119.04907227,-1129.85498047,25.20104599,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2121.09472656,-1151.64074707,23.91438675,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(580,1775.21545410,-1060.92016602,23.86846161,0.00000000,-1,-1,15); //Stafford
    AddStaticVehicleEx(445,1770.82995605,-1060.26843262,23.95093727,0.00000000,-1,-1,15); //Admiral
    AddStaticVehicleEx(445,1784.41284180,-1060.60559082,23.95093727,0.00000000,-1,-1,15); //Admiral
    AddStaticVehicleEx(575,1788.75000000,-1060.89147949,23.70093727,0.00000000,-1,-1,15); //Broadway
    AddStaticVehicleEx(546,1793.11547852,-1061.27575684,23.80278587,0.00000000,-1,-1,15); //Intruder
    AddStaticVehicleEx(546,1771.42822266,-1069.39794922,23.80278587,0.00000000,-1,-1,15); //Intruder
    AddStaticVehicleEx(540,1762.43652344,-1060.82360840,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1753.28491211,-1046.84643555,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1762.11145020,-1046.75854492,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1780.08581543,-1069.31420898,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1788.75891113,-1069.08166504,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1757.68737793,-1037.99804688,23.94043922,179.99963379,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1505.85107422,-1750.89733887,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1509.48144531,-1750.87683105,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1456.82458496,-1750.22265625,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1452.82092285,-1750.36853027,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(596,1535.63977051,-1666.76635742,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1535.59960938,-1678.36694336,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1551.74267578,-1614.70031738,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1555.20043945,-1614.87866211,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1558.44396973,-1615.00390625,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1561.68725586,-1615.06262207,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1565.02331543,-1614.94067383,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1568.47241211,-1614.91613770,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1571.61572266,-1615.12951660,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1575.02124023,-1615.11669922,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(427,1591.12182617,-1710.61511230,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1594.79626465,-1710.45642090,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1587.14685059,-1710.29882812,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1583.18273926,-1710.10070801,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1578.79370117,-1709.84423828,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1574.03100586,-1709.80981445,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1569.95654297,-1709.86560059,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1559.53906250,-1710.16638184,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(411,1530.06079102,-1684.61120605,5.69062471,272.00000000,-1,-1,15); //Infernus
    AddStaticVehicleEx(411,1530.25805664,-1688.31982422,5.69062471,272.00000000,-1,-1,15); //Infernus
    return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid,2229.348388,-1159.111653,25.806554);
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(0xFFFF00AA, str);
        return 1;
    }
    return 0;

    dcmd(exitveh, 7, cmdtext);
    dcmd(engine, 6, cmdtext);
    dcmd(money, 5, cmdtext);
    return 0;
}
dcmd_engine(playerid, params[])
{
    #pragma unused params
    new vehicleid = GetPlayerVehicleID(playerid);
    if(Engine[vehicleid] == 0)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Engine Starting...");
    SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
    }
    else if(Engine[vehicleid] == 1)
    {
    Engine[vehicleid] = 0;
    SendClientMessage(playerid, COLOR_RED, "Engine Stopped...");
    SendClientMessage(playerid, COLOR_YELLOW, "To exit the vehicle press (F Key) Or (Enter)");
    SendClientMessage(playerid, COLOR_YELLOW, "Press (Shift) or Type (/engine) to start the vehicles engine");
    TogglePlayerControllable(playerid,0);
    }
    return 1;
}

dcmd_exitveh(playerid, params[])
{
        #pragma unused params
        if(IsPlayerInAnyVehicle(playerid))
        {
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid, 1);
        }
        else
        {
        SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle");
        }
        return 1;
}
dcmd_money(playerid, params[])
{
    new PID, Cash;
    if(sscanf(params, "ui", PID, Cash)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /Setmoney < PlayerID > < money >");
    if(!IsPlayerConnected(PID)) return 0;

    SetPlayerMoney(PID, Cash);
    return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SendClientMessage(playerid, 0x1229FAFF, " [RR-RP]You are entering a State car! Drive careful!");
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    SendClientMessage(playerid, 0x1229FAFF, "[RR-RP]You Leaved the car, DON'T Forget to park it rigth!");
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
  new vehicleid = GetPlayerVehicleID(playerid);
  if(Engine[vehicleid] == 0)
  {
  TogglePlayerControllable(playerid, 0);
  SendClientMessage(playerid, COLOR_YELLOW, "Press (Shift) or Type (/engine) to start the vehicles engine");
  }
  else if(Engine[vehicleid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Engine Running...");
    }
}
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid))
    {
    if(Engine[vehicleid] == 0)
    {
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid, 1);
    }
    else if(newkeys & KEY_JUMP)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Engine Starting...");
    SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
    }
    }
    }
    return 1;
    }

public EngineTimer(playerid)
{
    new rand = random(2);

    if(rand == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "Engine Started...");
        SendClientMessage(playerid, COLOR_YELLOW, "To turn off the vehicle, Type (/engine)");
        new vehicleid = GetPlayerVehicleID(playerid);
        Engine[vehicleid] = 1;
        TogglePlayerControllable(playerid, 1);
    }
    else if(rand == 1) //else if instead of 'if'
    {
        SendClientMessage(playerid, COLOR_GREEN, "Engine Failed...");
        SendClientMessage(playerid, COLOR_YELLOW, "Try Again");
    }
}
public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}
public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
I think it's all on the rigth zone.... But it don't work... How to define the fricken SetPlayerMoney?
Reply
#8

Instead

pawn Код:
SetPlayerMoney(PID, Cash);
Put:

pawn Код:
ResetPlayerMoney(playerid) && GivePlayerMoney(PID, Cash);
Reply
#9

Thanks you very mutch now it work well! 1 think... how we define what the cmd do? How cmd know what he set?
Reply
#10

Quote:
Originally Posted by Ricardo187
Посмотреть сообщение
Thanks you very mutch now it work well! 1 think... how we define what the cmd do? How cmd know what he set?
Didnt understand well. But I think it all depends their params, and are defined by:
pawn Код:
dcmd(command,amount,cmdtext);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)