Script Request Thread #4

Can someone help me or not?
Reply

Can someone make so that just a skin could write a special command?
Because i have a gate: /oygate (Openyakuzagate) but everyone can do it.
So can someone make so that only a special skin can?
Reply

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
an if statement + GetPlayerSkin
What?
I am a newbie pawner.
Reply

Quote:
Originally Posted by Str4ndb3rg
Посмотреть сообщение
What?
I am a newbie pawner.
https://sampwiki.blast.hk/wiki/GetPlayerSkin

Use this in an if condition just after your command if condition:

pawn Код:
if(strcmp(...))    //Your oygate command
{
    if(GetPlayerSkin(playerid) != the_skin_id_that_is_allowed_to_open) return 1;    //ends the command here
    //your further normal gate code
    ...
}
Reply

Can someone make me a Job system;

I need;

Fort Carson Sheriff Dept
Fort Carson EMS
Fort Carson Government
Fort Carson Fire Dept

Thank you, Luis.
Reply

[QUOTE=Mauzen;852690]https://sampwiki.blast.hk/wiki/GetPlayerSkin

Use this in an if condition just after your command if condition:

pawn Код:
if(strcmp(...))    //Your oygate command
{
    if(GetPlayerSkin(playerid) != the_skin_id_that_is_allowed_to_open) return 1;    //ends the command here
    //your further normal gate code
    ...
}
Код:
What i wrote:
[quote]
    if(strcmp(cmdtext, "/Pgopen", true) == 0)
    {
    if(GetPlayerSkin(playerid) != 24) return 1;    //ends the command here
        new string[50];
        new movetime = MoveObject(gate, -224.91983032,929.99670410,-8.98811340,5);
        format(string, sizeof(string), "Prison Gates Are Opening", movetime);
		SendClientMessage(playerid, 0xFF000000, string);

		return 1;
	}
The error.
Код:
C:\Users\Alle\Desktop\GTA SA Shit\GTA Server\gamemodes\EQ-RP.pwn(542) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply

Quote:
Originally Posted by Whatever your name is
[/code]
The error.
Код:
C:\Users\Alle\Desktop\GTA SA Shit\GTA Server\gamemodes\EQ-RP.pwn(542) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Easy to fix mate you put it all in lines
Reply

Quote:
Originally Posted by riddy123
Посмотреть сообщение
Easy to fix mate you put it all in lines
Great thanks

New: How to make text on the peds when in the selection scene?
Reply

I have been trying many diffrent way to convert this code to mysql but i just haven't found a way, I get it to work but it dosen't load as it's suppose to. It just shows blank info. A little help on how to convert this to mysql?

pawn Код:
format(str, sizeof(str), "Vehicles/Players/%s.cfg", plname);
    if(dini_Exists(str))
    {
        strmid(PlayerVehicle[playerid][pVeh1], dini_Get(str, "Vehicle1"), 0, strlen(dini_Get(str, "Vehicle1")), 255);
        strmid(PlayerVehicle[playerid][pVeh2], dini_Get(str, "Vehicle2"), 0, strlen(dini_Get(str, "Vehicle2")), 255);
        strmid(PlayerVehicle[playerid][pVeh3], dini_Get(str, "Vehicle3"), 0, strlen(dini_Get(str, "Vehicle3")), 255);
        strmid(PlayerVehicle[playerid][pVeh4], dini_Get(str, "Vehicle4"), 0, strlen(dini_Get(str, "Vehicle4")), 255);
        strmid(PlayerVehicle[playerid][pVeh5], dini_Get(str, "Vehicle5"), 0, strlen(dini_Get(str, "Vehicle5")), 255);
        return 1;
    }
    else
    {
        dini_Create(str);
        strmid(PlayerVehicle[playerid][pVeh1], "None", 0, strlen("None"), 255);
        strmid(PlayerVehicle[playerid][pVeh2], "None", 0, strlen("None"), 255);
        strmid(PlayerVehicle[playerid][pVeh3], "None", 0, strlen("None"), 255);
        strmid(PlayerVehicle[playerid][pVeh4], "None", 0, strlen("None"), 255);
        strmid(PlayerVehicle[playerid][pVeh5], "None", 0, strlen("None"), 255);
        //return 1;
    }
This is OnplayerConnect, Basically what it does is if you own a vehicle it loads them. If you don't own a vehicle it sets all your vehicles to "None"

Oh and sscanf2 if possible
Reply

Quote:
Originally Posted by Str4ndb3rg
Посмотреть сообщение
Great thanks

New: How to make text on the peds when in the selection scene?
I still need help :/
Reply

Quote:
Originally Posted by nickzanna
Посмотреть сообщение
I do I need a registration filterscript (Not admin commands). : D
Errorcons (I think its his name) made a good register system, look forward into it (Its dialog)
Reply

Hello I need the new includes OR a updated gamemode thats 0.3b for my RP server the script name is crpnew thats the name of it in the gamemodes folder :P please give the link or something that would upgrade it to 0.3b thank you in advance
Reply

Re-Download SA-MP Server Package.

SA:MP Downloads
Reply

Plz sameone make my skript:who BH a lot , that sent to the ajail.

(Sorry for my very bad English)
Reply

Quote:
Originally Posted by oliver12
Посмотреть сообщение
Plz sameone make my skript:who BH a lot , that sent to the ajail.

(Sorry for my very bad English)
I dont understand anything
Reply

Can someone explain me what means == 0 in this code: if(strcmp(cmdtext, "/mycommand") == 0).I think everyone know this code-begginer and also proffesional, but I want to know everything about that, because in another code 0 will be interprete like disabled and 1 like enabled, but in this code it's not disabled if player entered code matches text /mycommand.Thank you for the helping!
Reply

Quote:
Originally Posted by karakana7
Посмотреть сообщение
Can someone explain me what means == 0 in this code: if(strcmp(cmdtext, "/mycommand") == 0).I think everyone know this code-begginer and also proffesional, but I want to know everything about that, because in another code 0 will be interprete like disabled and 1 like enabled, but in this code it's not disabled if player entered code matches text /mycommand.Thank you for the helping!
the == 0 at the end i think should be the length of the command itself?
Reply

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
the == 0 at the end i think should be the length of the command itself?
So by you if the length of what typed player is equal to number 0(that means he typed nothing), than command will be executed?Lol that isn't normal, because he must enter the exact command like we writed in the script to get something done...
Reply

As far as I remember strcmp returns -1 is the first input it larger 0 if both are equal and 1 if the second input is larger and if the length of one input is zero it will aslo return 0 for fail
Reply

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
strcmp returns 0 if the two strings match so a quicker way to write that would be:

pawn Код:
if(!strcmp(cmdtext, "/command")) // you can add the ignorecase and length if you want.
if you want things super fast to write, make a little macro:

pawn Код:
#define Cmd(%1) if(!strcmp(cmdtext,%1,false,strlen(%1)))

// OnPlayerCommandText

    Cmd("/mycommand")
    {
I use it and it works well.
Isnt a bad idea.But i think ZCMD is faster :P
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)