How can I list all enum data in dialog box
#3

It's just showing 1 item, here is my full code of /addgpslocation
PHP код:
COMMAND:addgpslocation(playerid,params[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"Error: You are not authorized to use this  command.");
    new 
name[512];
    if(
sscanf(params"s[512]"name)) return SendClientMessage(playerid, -1"Usage: /addgpslocation [Name]");
    for(new 
i=0;i<sizeof(GPS);i++)
    {
        new 
Float:x,Float:y,Float:z;
        
GetPlayerPos(playeridxyz);
        
GPS[i][loc_name] = name;
        
GPS[i][loc_x] = x;
        
GPS[i][loc_y] = y;
        
GPS[i][loc_z] = z;
        
format(GPS[i][loc_name],512"%s"name);
        new 
query[256];
        
format(querysizeof(query),"INSERT INTO gps (loc_x,loc_y,loc_z,loc_name) VALUES ('%f','%f','%f','%s')",GPS[i][loc_x],GPS[i][loc_y],GPS[i][loc_z],GPS[i][loc_z],GPS[i][loc_name]);
         
mysql_function_query(dbhandle,query,false,"","");
         
printf("%s || ID : %i"query,i);
         
printf("Pos : %f,%f,%f"x,y,z);
         
SendClientMessage(playerid, -1"GPS: Location added successfully!");
         return 
1;
    }
    return 
1;

Maybe having some problem on loop :/
Reply


Messages In This Thread
How can I list all enum data in dialog box - by akib - 03.09.2018, 01:35
Re: How can I list all enum data in dialog box - by iHollyZinhO - 03.09.2018, 01:48
Re: How can I list all enum data in dialog box - by akib - 04.09.2018, 11:11
Re: How can I list all enum data in dialog box - by AmigaBlizzard - 04.09.2018, 11:20
Re: How can I list all enum data in dialog box - by akib - 04.09.2018, 11:24
Re: How can I list all enum data in dialog box - by akib - 04.09.2018, 12:28

Forum Jump:


Users browsing this thread: 1 Guest(s)