Jump to content

Problema comanda /vipname


Onehitkill

Recommended Posts

Am o problema cu comanda "/vipname"

 

Am pus scriptul asta:

 

CMD:vipname(playerid, params[])
{
    new text[6], szMessage[256];
    new vehicleid = GetPlayerVehicleID(playerid);

    if(sscanf(params, "s[50]", text)) return SCM(playerid, COLOR_WHITE, "SYNTAX: /vipname [name]");
    if(PlayerInfo[playerid][pPremiumAccount] != 1) return SCM(playerid, COLOR_ERROR, "You don't have a premium account");
    {
        if(vText[playerid] != -1) return SCM(playerid, COLOR_WHITE, "Use first /removename to put another name on your car.");
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You aren't in any car.");
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_ERROR, "You aren't the driver.");
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 411) return SCM(playerid, COLOR_ERROR, "Car must be an Infernus in order to apply this command.");

        if(OwnedVeh(vehicleid))
        {
            vText[playerid] = CreateObject(19327, -2597.0762, -2638.4270, -5.3536, -87.6999, 90.4001, -87.1805);

            SetObjectMaterialText(vText[playerid] , text, 0, 50, "Arial", 15, 1, 0xFFFFFFFF, 0, 1);
            AttachObjectToVehicle(vText[playerid] , vehicleid, 0.0,-1.9, 0.3, 270.0, 0.0, 0.0);

            format(szMessage, sizeof(szMessage), "{F2CF09}Vipname is: '%s'", text);
            SCM(playerid, COLOR_YELLOW, szMessage);

        new query[64];
        mysql_format(SQL,query,sizeof(query),"UPDATE users SET vipnameinf = '%s' WHERE PID = %d", text, PlayerInfo[playerid][pDatabaseID]);
        mysql_tquery(SQL,query,"","");
        }
    }
    return 1;
}

si imi da eroarea

 

C:\Users\#Scripter\Desktop\gamemodes\mavro.pwn(32415) : warning 217: loose indentation
C:\Users\#Scripter\Desktop\gamemodes\mavro.pwn(32416) : error 017: undefined symbol "pDatabaseID"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase

 

Liniile: 

(32415)        new query[64];
 (32416)       mysql_format(SQL,query,sizeof(query),"UPDATE users SET vipnameinf = '%s' WHERE PID = %d", text, PlayerInfo[playerid][pDatabaseID]);


1 Error.
 

 

Ma puteti ajuta ?. Am auzit ca trebuie sa fie conectat la baza de date ca sa ramana salvat ?

 

Edited by Onehitkill
Link to comment
Share on other sites

Acum 52 minute, Onehitkill a spus:

Am o problema cu comanda "/vipname"

 

Am pus scriptul asta:

 


CMD:vipname(playerid, params[])
{
    new text[6], szMessage[256];
    new vehicleid = GetPlayerVehicleID(playerid);

    if(sscanf(params, "s[50]", text)) return SCM(playerid, COLOR_WHITE, "SYNTAX: /vipname [name]");
    if(PlayerInfo[playerid][pPremiumAccount] != 1) return SCM(playerid, COLOR_ERROR, "You don't have a premium account");
    {
        if(vText[playerid] != -1) return SCM(playerid, COLOR_WHITE, "Use first /removename to put another name on your car.");
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You aren't in any car.");
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_ERROR, "You aren't the driver.");
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 411) return SCM(playerid, COLOR_ERROR, "Car must be an Infernus in order to apply this command.");

        if(OwnedVeh(vehicleid))
        {
            vText[playerid] = CreateObject(19327, -2597.0762, -2638.4270, -5.3536, -87.6999, 90.4001, -87.1805);

            SetObjectMaterialText(vText[playerid] , text, 0, 50, "Arial", 15, 1, 0xFFFFFFFF, 0, 1);
            AttachObjectToVehicle(vText[playerid] , vehicleid, 0.0,-1.9, 0.3, 270.0, 0.0, 0.0);

            format(szMessage, sizeof(szMessage), "{F2CF09}Vipname is: '%s'", text);
            SCM(playerid, COLOR_YELLOW, szMessage);

        new query[64];
        mysql_format(SQL,query,sizeof(query),"UPDATE users SET vipnameinf = '%s' WHERE PID = %d", text, PlayerInfo[playerid][pDatabaseID]);
        mysql_tquery(SQL,query,"","");
        }
    }
    return 1;
}

si imi da eroarea

 

C:\Users\#Scripter\Desktop\gamemodes\mavro.pwn(32415) : warning 217: loose indentation
C:\Users\#Scripter\Desktop\gamemodes\mavro.pwn(32416) : error 017: undefined symbol "pDatabaseID"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase

 

Liniile: 

(32415)        new query[64];
 (32416)       mysql_format(SQL,query,sizeof(query),"UPDATE users SET vipnameinf = '%s' WHERE PID = %d", text, PlayerInfo[playerid][pDatabaseID]);


1 Error.
 

 

Ma puteti ajuta ?. Am auzit ca trebuie sa fie conectat la baza de date ca sa ramana salvat ?

 

Uite am rezolvat eu loose indentation

CMD:vipname(playerid, params[])
{
    new text[6], szMessage[256];
    new vehicleid = GetPlayerVehicleID(playerid);

    if(sscanf(params, "s[50]", text)) return SCM(playerid, COLOR_WHITE, "SYNTAX: /vipname [name]");
    if(PlayerInfo[playerid][pPremiumAccount] != 1) return SCM(playerid, COLOR_ERROR, "You don't have a premium account");
    {
        if(vText[playerid] != -1) return SCM(playerid, COLOR_WHITE, "Use first /removename to put another name on your car.");
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You aren't in any car.");
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_ERROR, "You aren't the driver.");
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 411) return SCM(playerid, COLOR_ERROR, "Car must be an Infernus in order to apply this command.");

        if(OwnedVeh(vehicleid))
        {
            vText[playerid] = CreateObject(19327, -2597.0762, -2638.4270, -5.3536, -87.6999, 90.4001, -87.1805);

            SetObjectMaterialText(vText[playerid] , text, 0, 50, "Arial", 15, 1, 0xFFFFFFFF, 0, 1);
            AttachObjectToVehicle(vText[playerid] , vehicleid, 0.0,-1.9, 0.3, 270.0, 0.0, 0.0);

            format(szMessage, sizeof(szMessage), "{F2CF09}Vipname is: '%s'", text);
            SCM(playerid, COLOR_YELLOW, szMessage);

	        new query[64];
	        mysql_format(SQL,query,sizeof(query),"UPDATE users SET vipnameinf = '%s' WHERE PID = %d", text, PlayerInfo[playerid][pDatabaseID]);
	        mysql_tquery(SQL,query,"","");
        }
    }
    return 1;
}

Si da, vad ca nu ai variabila pDatabaseID, copiaza si tu dupa alta ce se aseamana cum ar fi pLevel sau ceva de genul cum ai tu levelul definit adica.

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

11 hours ago, Onehitkill said:

Am o problema cu comanda "/vipname"

 

Am pus scriptul asta:

 


CMD:vipname(playerid, params[])
{
    new text[6], szMessage[256];
    new vehicleid = GetPlayerVehicleID(playerid);

    if(sscanf(params, "s[50]", text)) return SCM(playerid, COLOR_WHITE, "SYNTAX: /vipname [name]");
    if(PlayerInfo[playerid][pPremiumAccount] != 1) return SCM(playerid, COLOR_ERROR, "You don't have a premium account");
    {
        if(vText[playerid] != -1) return SCM(playerid, COLOR_WHITE, "Use first /removename to put another name on your car.");
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You aren't in any car.");
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_ERROR, "You aren't the driver.");
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 411) return SCM(playerid, COLOR_ERROR, "Car must be an Infernus in order to apply this command.");

        if(OwnedVeh(vehicleid))
        {
            vText[playerid] = CreateObject(19327, -2597.0762, -2638.4270, -5.3536, -87.6999, 90.4001, -87.1805);

            SetObjectMaterialText(vText[playerid] , text, 0, 50, "Arial", 15, 1, 0xFFFFFFFF, 0, 1);
            AttachObjectToVehicle(vText[playerid] , vehicleid, 0.0,-1.9, 0.3, 270.0, 0.0, 0.0);

            format(szMessage, sizeof(szMessage), "{F2CF09}Vipname is: '%s'", text);
            SCM(playerid, COLOR_YELLOW, szMessage);

        new query[64];
        mysql_format(SQL,query,sizeof(query),"UPDATE users SET vipnameinf = '%s' WHERE PID = %d", text, PlayerInfo[playerid][pDatabaseID]);
        mysql_tquery(SQL,query,"","");
        }
    }
    return 1;
}

si imi da eroarea

 

C:\Users\#Scripter\Desktop\gamemodes\mavro.pwn(32415) : warning 217: loose indentation
C:\Users\#Scripter\Desktop\gamemodes\mavro.pwn(32416) : error 017: undefined symbol "pDatabaseID"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase

 

Liniile: 

(32415)        new query[64];
 (32416)       mysql_format(SQL,query,sizeof(query),"UPDATE users SET vipnameinf = '%s' WHERE PID = %d", text, PlayerInfo[playerid][pDatabaseID]);


1 Error.
 

 

Ma puteti ajuta ?. Am auzit ca trebuie sa fie conectat la baza de date ca sa ramana salvat ?

 

Mai uitate la tutoriale sa vezi ce sunt variabilele acelea, macar sa pricepi ce este acolo.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.