Problem With Sscanf
#1

Hey guys, I got a problem
I have sscanf and I read in the wiki "u" parameter works with partname/id, but when i try with partname (for example /repaircar bu11) return id 0

someone know what it's wrong? or if it doesn't exist.

Sorry for bad English, i'm spanish D:
Reply
#2

Show your command
Reply
#3

pawn Код:
dcmd_repaircar(playerid, params[])
{
    new giveplayerid;
    if(PlayerInfo[playerid][Duty] < 3) return 0;
    if(sscanf(params, "u", giveplayerid))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, ERROR, "ERROR: Player has not a vehicle");
        return RepairVehicle(GetPlayerVehicleID(playerid));
    }
    else
    {
        if(!IsPlayerInAnyVehicle(giveplayerid)) return SendClientMessage(playerid, ERROR, "ERROR: Player don't have a vehicle!!");
        return RepairVehicle(GetPlayerVehicleID(giveplayerid));
    }
    return 1;
}
It works with ID's, but don't work with names
Reply
#4

What is your actual ingame ID and name?
Reply
#5

pawn Код:
dcmd_repaircar(playerid, params[])
{
    if(PlayerInfo[playerid][Duty] < 3) return 0;

    new giveplayerid;
    if(sscanf(params, "r", giveplayerid))
        return SendClientMessage(playerid, ERROR, "/repaircar [Nick/ID]");

    if(!IsPlayerInAnyVehicle(giveplayerid)) return SendClientMessage(playerid, ERROR, "ERROR: Player has not a vehicle");
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
}
Reply
#6

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
What is your actual ingame ID and name?
My Nickname is Bu11Sh0t, and my ID varies from 1 to 5 (id 0 is from an NPC)

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
pawn Код:
dcmd_repaircar(playerid, params[])
{
    if(PlayerInfo[playerid][Duty] < 3) return 0;

    new giveplayerid;
    if(sscanf(params, "r", giveplayerid))
        return SendClientMessage(playerid, ERROR, "/repaircar [Nick/ID]");

    if(!IsPlayerInAnyVehicle(giveplayerid)) return SendClientMessage(playerid, ERROR, "ERROR: Player has not a vehicle");
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
}
With the 'r' return a "Server: Unknow Command" , anyone has another idea?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)