Que esta mal en este comando
#1

Hola bueno estoy creando un GPS y hize este comando :

pawn Код:
if (strcmp("/ComprarGPS", cmdtext, true, 10) == 0)
    {
        if(GetPlayerMoney(playerid) < 5999)
        {
           if(tienegps[playerid] == 0)
           {
              if(PlayerToPoint(20.0, playerid, 1081.7438,-1225.2666,10.3536))
              {
              SendClientMessage(playerid, VERDE, " Has Comprado Un GPS ! /ayudaGPS si tienes alguna duda ");
              GivePlayerMoney(playerid, -6000);
              tienegps[playerid] = 1;
              return 1;
              }
              else
              {
              SendClientMessage(playerid, AMARILLO, " No Estas En El Negocio !");
           }
           else
           {
            SendClientMessage(playerid, AMARILLO, " Ya Tienes Un Gps ! /AyudaGPS para mas info ");
        }
        else
        {
         SendClientMessage(playerid, AMARILLO, " No Tienes Suficiente Dinero !");
    }
Y me tira los errores como si un Corchete estubiera mal ahora
Le Saco los else y los SendClientMessage y compila perfecto que es?
Reply
#2

Proba asi:

pawn Код:
if (strcmp("/ComprarGPS", cmdtext, true, 10) == 0)
    {
        if(GetPlayerMoney(playerid) < 5999) return SendClientMessage(playerid, 0xFF000000, "Ya tienes el dinero");
        {
           if(tienegps[playerid] == 0) return SendClientMessage(playerid, 0xFF000000, "Ya tienes GPS");
           {
              if(PlayerToPoint(20.0, playerid, 1081.7438,-1225.2666,10.3536)) return SendClientMessage(playerid, 0xFF000000, "No Estas en el 24/7");
              {
              SendClientMessage(playerid, VERDE, " Has Comprado Un GPS ! /ayudaGPS si tienes alguna duda ");
              GivePlayerMoney(playerid, -6000);
              tienegps[playerid] = 1;
              }
            }
         }
       return 1;
     }
No estoy seguro, ni lo probe, pero como dicen, mejor algo que nada xd
Reply
#3

Ahora pruebo

DUDA: por que pusiste " Ya Tienes El Dinero " Si yo en esa funcion lo que buscaba era que Si no tiene el dinero
No te Deje poner el comando ?
Reply
#4

Me tira estos Warnings:

Код:
C:\Documents and Settings\fede\Mis documentos\[0.3c]Los Santos RP - Modificado 4.8\[0.3c]Los Santos RP - Modificado 4.8\filterscripts\GPS.pwn(92) : warning 217: loose indentation
C:\Documents and Settings\fede\Mis documentos\[0.3c]Los Santos RP - Modificado 4.8\[0.3c]Los Santos RP - Modificado 4.8\filterscripts\GPS.pwn(106) : warning 217: loose indentation
C:\Documents and Settings\fede\Mis documentos\[0.3c]Los Santos RP - Modificado 4.8\[0.3c]Los Santos RP - Modificado 4.8\filterscripts\GPS.pwn(108) : warning 217: loose indentation
LAS LINEAS SON:

pawn Код:
if (strcmp("/ComprarGPS", cmdtext, true, 10) == 0) // linea 92

       return 1; // linea 106

return 0; // linea 108
Que significan?

EDIT: Ya lo solucione Me Faltaba poner Arriva de todo:

pawn Код:
#pragma tabsize 0
GRACIAS IGUAL !
Reply
#5

de nada xd esos warnings no alteran el script, quieren decir que tu script desordenado, por decirlo de alguna manera:

pawn Код:
,     Kick(playerid);//aca tendras ese warn por que esta desornado
Ban(playerid1);
Forma correcta:

pawn Код:
Kick(playerid);
Ban(playerid1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)