Little coding questions - For general minor queries 5

Fixed myself, lol had a bracket missing.
Reply

If you pass -1 as the respawn time they shouldn't respawn. Probably a bug that's making em respawn.

PS, Make sure your using CreateVehicle.
Reply

hello guys
i found this and it work fine but when i get ultimate ammo it will save like -37201
https://sampforum.blast.hk/showthread.php?tid=131493
how to save gun ammo with value 99999 ??
Reply

Hey I'm working on Calgon base mysql script and I'm trying to make autosave in OnGameModeExit
like when the server crashes or shutdown by closing the CMD window or by using /rcon gmx
its will automatic save the player data.

I tried to do this:


PHP код:
OnGameModeExit() { 
    for (new 
0!= MAX_PLAYERS; ++i
    { 
        
savePlayer(i); 
    } 
    
mysql_close(iConnectionHandle); 
    return 
1

and when I'm login its spawn me at the air above the farm at blueberry.
anyone can help me please?

Thanks FuznesS.
Reply

Hey i have a weird problem, which would be when i enter a vehicle, does i have to press Key_Handbrake, this is correct to turn the engine on, but it also shall turn the lights on which doesn't happen, they turn only on when i leave the vehicle. Here the code:

pawn Код:
public EngineTimer(playerid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,1, alarm,doors, bonnet, boot, objective);
    return 1;
}
He is in a Timer Callback, because the engine shall start after a small duration. Everything works fine only this stupid lights not. Would great when someone can tell me what i've done wrong.
Reply

Quote:
Originally Posted by FuznesS
Посмотреть сообщение
Hey I'm working on Calgon base mysql script and I'm trying to make autosave in OnGameModeExit
like when the server crashes or shutdown by closing the CMD window or by using /rcon gmx
its will automatic save the player data.

I tried to do this:


PHP код:
OnGameModeExit() { 
    for (new 
0!= MAX_PLAYERS; ++i
    { 
        
savePlayer(i); 
    } 
    
mysql_close(iConnectionHandle); 
    return 
1

and when I'm login its spawn me at the air above the farm at blueberry.
anyone can help me please?

Thanks FuznesS.
You can't save data in that callback, AFAIK. The server closes too fast.
Reply

Quote:
Originally Posted by MP2
Посмотреть сообщение
You can't save data in that callback, AFAIK. The server closes too fast.
There is any way to save the players data when the server closes?
Reply

Quote:
Originally Posted by FuznesS
Посмотреть сообщение
There is any way to save the players data when the server closes?
You can create a timer which repeats and saves the player's data in specified time. So, that it might save the data before the server gets shut down. If you are using MySQL and the data isn't too big, you can use 15 seconds to save those.
Reply

hello guys if i use TextDrawHideForPlayer it will make server laggy ? so i must use this PlayerTextDrawDestroy or its nothing about it
if i use one of them its just ok ? !!!

becuase i have like 670 line of textdraws TextDrawHideForPlayer them i must change them all to PlayerTextDrawDestroy ?

or its just ok if i use TextDrawHideForPlayer and when there is lots of player joining will not lagg and make server buggy ?
Reply

Quote:
Originally Posted by FuznesS
Посмотреть сообщение
There is any way to save the players data when the server closes?
Just use a custom command to restart the server, heres a quick example:
pawn Код:
CMD:gmx(playerid, params[]) {
   SavePlayerData();
   SendRconCommand("gmx");
   return 1;
}
Reply

Hey, I'm trying out the zGaming script and I've encountered a bug which involves the phone. I've tried searching both here and ******, but I couldn't find an answer, only questions. So therefor I turn to you guys, I appreciate any help I get - here's the code:

http://pastebin.com/KDqEWjGA/raw

I suspect it has to do with the hangup function but I'm not sure.
The bug makes it so that the player who is being called can't hangup the phone properly, even if they type /hangup they're still on the phone and talks to the person who is calling.

Thanks.
Reply

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
Sorry double post but it has passed some days:

My question: What does %02d, the 02 mean in that?

Example:
https://sampwiki.blast.hk/wiki/Getdate
https://sampwiki.blast.hk/wiki/Gettime
It means the number will have 2 digits, for example if the hour was 7, it would be "07" and not "7",
If you used %04d, it would become "0007" (4 digits), if you used %08d it would become "00000007" (8 digits)

Obviously for the hour (for the minutes and for the seconds too) you will want to display 2 digits only
Reply

What is the object id for a podium?
Reply

Quote:
Originally Posted by seanny
Посмотреть сообщение
What is the object id for a podium?
Do you have a picture or something that could help ?
Reply

In y_ini, can you make multiple SetTag's in one and the same file? And then by that making some sort of structure? And also can you make a SetTag(fileHere, ""); that is empty to make it even more structured, or might it bug the whole file?
Reply

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
In y_ini, can you make multiple SetTag's in one and the same file? And then by that making some sort of structure? And also can you make a SetTag(fileHere, ""); that is empty to make it even more structured, or might it bug the whole file?
yes. the whole idea around tags are meant to 'structure' files anyways. and there's no point in creating an empty tag just to space out your code..
Reply

Hi guys, is it possible to add new guns, (not replacing the old guns) with custom.img (ik i am the only person who can see it).??

EDIT:

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
Sorry double post but it has passed some days:

My question: What does %02d, the 02 mean in that?

Example:
https://sampwiki.blast.hk/wiki/Getdate
https://sampwiki.blast.hk/wiki/Gettime
See Here, click me

.................................................. .................................................. ............

Is it possible to add my custom texture to object. if yes, will the texture of attached object be changed?
Reply

Thanks newbie! :P

And just a quick question, I don't really want a script on this, I would want to figure this one out by myself how to make this work but would it work to make so CLEO is allowed for ALL players that connects to my server (don't actually own one but yeah...) despite the fact that they don't even ever have downloaded CLEO. Just a question, don't need an explanation on how to do it (yet haha)? :P
Reply

Alright thanks Y_Less.

Another noob question:
How can I, with zcmd, make a command with string options like with /command [options], where "options" is a string that the player puts in. I tried something stupid like if(option == "lol") but obviously something like that would only work for integers (numbers). Is there any good way to do it with zcmd? Just a simple example would do the trick of teaching me how to do it! :P

If you don't understand what I'm trying to do, imagine this then: I am doing an /info command. And if you type in "/info mysql" it will show one SendClientMessage. If you type in "/info y_ini", it will show another informational SendClientMessage. That is basically what I'm trying to learn here. :P
Reply

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
Alright thanks Y_Less.

Another noob question:
How can I, with zcmd, make a command with string options like with /command [options], where "options" is a string that the player puts in. I tried something stupid like if(option == "lol") but obviously something like that would only work for integers (numbers). Is there any good way to do it with zcmd? Just a simple example would do the trick of teaching me how to do it! :P

If you don't understand what I'm trying to do, imagine this then: I am doing an /info command. And if you type in "/info mysql" it will show one SendClientMessage. If you type in "/info y_ini", it will show another informational SendClientMessage. That is basically what I'm trying to learn here. :P
You can compare strings using strcmp, I think that answers your question..
Reply


Forum Jump:


Users browsing this thread: 24 Guest(s)