SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 25 of 81
Search took 0.01 seconds.
Search: Posts Made By: Rolux
Forum: Scripting Help 27/02/2020, 12:30 PM
Replies: 5
Views: 160
Posted By Rolux
Re: MySQL Query not working

Anything useful in the logs/errors.txt?
Forum: Scripting Help 21/02/2020, 10:35 AM
Replies: 3
Views: 202
Posted By Rolux
Re: EOS Question

EOS means End Of String.
You can insert it into a string to mark it's end. Like:
new string[32] = "Hello Wolrd!";
string[5] = EOS;
print(string);

This code will print: "Hello", because...
Forum: Scripting Help 12/02/2020, 03:13 AM
Replies: 5
Views: 249
Posted By Rolux
Re: Firstname_Lastname

public OnPlayerConnect(playerid)
{
SetTimerEx("ChangeName", 100, false, "i", playerid);
return 1;
}

forward ChangeName(playerid);
public ChangeName(playerid)
{
NameToUpperCase(...
Forum: Scripting Help 09/02/2020, 06:54 PM
Replies: 5
Views: 163
Posted By Rolux
Re: Function IdByName worked 5 years for me,now don't work good

I think it should be fine when you give the full name of the player.
Forum: Scripting Help 09/02/2020, 06:31 PM
Replies: 5
Views: 163
Posted By Rolux
Re: Function IdByName worked 5 years for me,now don't work good

You should use sscanf for that:

GetPlayerID(name[])
{
new playerid = INVALID_PLAYER_ID;
sscanf(name, "u", playerid);
return playerid;
}
Forum: Scripting Help 09/02/2020, 02:13 PM
Replies: 4
Views: 165
Posted By Rolux
Re: First word of a string

You are overcomplicating it a little. :D

public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(gettime() < (GetPVarInt(playerid,GetFirstWord(cmdtext)) + 1))
{
...
Forum: Scripting Help 09/02/2020, 01:19 PM
Replies: 5
Views: 249
Posted By Rolux
Re: Firstname_Lastname

LINK (https://pastebin.com/RSeDpDad)

Use it like this:
public OnPlayerRequestClass(playerid,classid)
{
NameToUpperCase( playerid );
}
Forum: Scripting Help 09/02/2020, 12:26 PM
Replies: 4
Views: 165
Posted By Rolux
Re: First word of a string

GetFirstWord( string[] )
{
new
word[64],
pos = strfind(string, " ", true);

format(word,sizeof word,"%s",string);

if(pos != -1)
{
Forum: Scripting Help 25/01/2020, 07:00 PM
Replies: 3
Views: 717
Posted By Rolux
Re: Voice chat in SAMP - possibility?

Someone already did it:
https://github.com/CyberMor/sampvoice
Forum: Includes 14/09/2019, 07:56 AM
Replies: 3
Views: 1,172
Posted By Rolux
Re: EasyConvert.inc | Converting Variables!

Sorry,but this is pretty useless.
+The float parts are not working.
Forum: Scripting Help 19/06/2019, 05:42 PM
Replies: 4
Views: 239
Posted By Rolux
Re: Concatenating help

strcat is for concatenating two STRING together.

new string[8];
//strcat(string,Waybill[WaybillNumber]); //WRONG,and it should give "error 035: argument type mismatch (argument 2)". Use format:...
Forum: Scripting Help 19/06/2019, 04:46 PM
Replies: 4
Views: 239
Posted By Rolux
Re: Concatenating help

So, Waybill[WaybillNumber] is an integer?
Forum: Scripting Help 03/06/2019, 03:25 AM
Replies: 3
Views: 261
Posted By Rolux
Re: Convert minutes into hours/days

Not it's not.

new playedminutes = 24*60+46;//your variable
new days = (playedminutes / 60) % 24;
new hours = playedminutes / 60 / 24;
new minutes = (playedminutes) % 60;
printf("d:%d h:%d...
Forum: Scripting Help 31/05/2019, 07:21 AM
Replies: 4
Views: 218
Posted By Rolux
Re: Wait 10 Seconds

You don't have to use a timer for that.

new gLastDamage[MAX_PLAYERS];

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
...
Forum: Scripting Help 05/05/2019, 06:51 AM
Replies: 5
Views: 224
Posted By Rolux
Re: Why isn't this MySQL code working?

https://i.imgur.com/ozrsaBE.png

https://wiki.sa-mp.com/wiki/MySQL/R33#cache_get_field_content
Forum: Scripting Help 02/05/2019, 08:06 AM
Replies: 3
Views: 154
Posted By Rolux
Re: Is there an easier way to do this? fread the LAST 20 lines?

fseek has some default parameters,so if I leave it blank it will use them.
native fseek(File: handle, position = 0, seek_whence: whence = seek_start);



and:
if(++lines <= id) continue;
is...
Forum: Scripting Help 02/05/2019, 05:13 AM
Replies: 3
Views: 154
Posted By Rolux
Re: Is there an easier way to do this? fread the LAST 20 lines?

CMD:logs(playerid, params[])
{
new targetid,linesToRead = 20;
if(sscanf(params, "u", targetid)) return SCM(playerid, -1, "USAGE: /logs <user/id>");

new filename[128];
format(filename,...
Forum: Scripting Help 30/04/2019, 06:48 PM
Replies: 8
Views: 226
Posted By Rolux
Re: Tutorial system in array?

return SetTimerEx("OnPlayerTutorialCameraUpdate", TutorialData[0][tutorialInterval] * 1000, false, "ii", playerid, 0);
Forum: Scripting Help 24/04/2019, 04:55 AM
Replies: 9
Views: 269
Posted By Rolux
Re: Problem car

That varibale "l" was unnecessary and you never set it's value,so it was always 0.


forward OnVehiclesLoad();
public OnVehiclesLoad()
{
new results = cache_num_rows();
new strlabel[100];...
Forum: Scripting Help 23/04/2019, 05:04 PM
Replies: 5
Views: 192
Posted By Rolux
Re: /music command with array

new mInfos[ MAX_SONGS ][ mData ] = {

{"Test song", "http://g00gle.com"}
};
Forum: Scripting Help 23/04/2019, 06:57 AM
Replies: 9
Views: 269
Posted By Rolux
Re: Problem car

You shloud format the text before creating the 3dtext.


format(strlabel, sizeof(strlabel), "Vehicle UID: %d\nOwner: %s", PrivCarInfo[l][UID], PrivCarInfo[l][Owner]);...
Forum: Scripting Help 05/01/2019, 12:39 PM
Replies: 11
Views: 435
Posted By Rolux
Re: Help me with mysql R40

Does it give you the same error as before?
Forum: Scripting Help 05/01/2019, 12:24 PM
Replies: 11
Views: 435
Posted By Rolux
Re: Help me with mysql R40

forward Query_LoadCharacter(playerid);
public Query_LoadCharacter(playerid)
{
new rows = cache_num_rows();

if(!rows)
{
printf("[SERVER]: No clans were loaded from the...
Forum: Scripting Help 05/01/2019, 12:10 PM
Replies: 5
Views: 195
Posted By Rolux
Re: OnPlayerDeath gives money

Can you show me your OnPlayerSpawn?
Forum: Scripting Help 05/01/2019, 12:07 PM
Replies: 11
Views: 435
Posted By Rolux
Re: Help me with mysql R40

I meant the one which calls "Query_LoadCharacter".
Showing results 1 to 25 of 81

 

All times are GMT. The time now is 10:31 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.