Problem In /setsong Command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem In /setsong Command (
/showthread.php?tid=509840)
Problem In /setsong Command -
Youssef214 - 28.04.2014
I am getting A Problem in these codes:
pawn Код:
if(!strcmp(cmdtext, "/setsong", true))
{
new SongID;
if(sscanf(params, "d", SongID))
{
SendClientMessage(playerid, -1, "USAGE: /setsong [SongID]");
SendClientMessage(playerid, -1, "Note: Song IDs: 1 - Ridin' Dirty Song 2 - GTA San Andreas Trailer Song");
} // SSCANF, if you didn't type a prize the message /setlotto <prize> will show up as a syntax error
if(SongID == 1)
{
Favouritesong[playerid] = 1;
SendClientMessage(playerid, -1, "Successfully Saved Ridin' Dirty Song! Use /usesong To Listen To It");
}
if(SongID == 2)
{
Favouritesong[playerid] = 2;
SendClientMessage(playerid, -1, "Successfully Saved GTA San Andreas Trailer Song! Use /usesong To Listen To It");
}
return 1;
}
problem:
pawn Код:
C:\Users\Ahmad\Downloads\Compressed\tg6cmaw4donijkrs8lvpf92u3y57eb\clients\port_2222\gamemodes\LSGW2.pwn(1482) : error 017: undefined symbol "params"
And When I Define It,It Gives Me Another Problem:
pawn Код:
C:\Users\Ahmad\Downloads\Compressed\tg6cmaw4donijkrs8lvpf92u3y57eb\clients\port_2222\gamemodes\LSGW2.pwn(1482) : error 035: argument type mismatch (argument 1)
Please Help.
Re: Problem In /setsong Command -
superrobot48 - 28.04.2014
and ur problem is that there is nothing u've defined called params
do somethin like
pawn Код:
#include zcmd
CMD:setsong(playerid,params[])
{
new SongID;
if(sscanf(params, "d", SongID))
{
SendClientMessage(playerid, -1, "USAGE: /setsong [SongID]");
SendClientMessage(playerid, -1, "Note: Song IDs: 1 - Ridin' Dirty Song 2 - GTA San Andreas Trailer Song");
} // SSCANF, if you didn't type a prize the message /setlotto <prize> will show up as a syntax error
if(SongID == 1)
{
Favouritesong[playerid] = 1;
SendClientMessage(playerid, -1, "Successfully Saved Ridin' Dirty Song! Use /usesong To Listen To It");
}
if(SongID == 2)
{
Favouritesong[playerid] = 2;
SendClientMessage(playerid, -1, "Successfully Saved GTA San Andreas Trailer Song! Use /usesong To Listen To It");
}
return 1;
}
Re: Problem In /setsong Command -
Youssef214 - 28.04.2014
i don't perfare to use zcmd because a lot of my commands uses if(strcmp
Re: Problem In /setsong Command -
superrobot48 - 28.04.2014
then use like cmdtext instead of SongID ? -_-
read
https://sampforum.blast.hk/showthread.php?tid=280387